----------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\csiemrot\Desktop\GNS 2014 Stata code\tablecreate.log
  log type:  text
 opened on:  19 Jun 2016, 19:51:21

. do "C:\Users\csiemrot\Desktop\GNS 2014 Stata code\tablecreate.do"

. *******************
. *Do-file creating the tables in
. *"A Field Experiment in Motivating Employee Ideas"
. *by Michael Gibbs, Susanne Neckermann, and Christoph Siemroth, 2016
. *******************
. 
. ******************
. **** Table 1: DESCRIPTIVE STATISTICS OF EXPLANATORY VARIABLES
. *****************
. use person-inactive-expost.dta, clear

. eststo clear

. drop if pilot==.
(2 observations deleted)

. gen indx=1

. replace indx=2 if pilot==0
(13,577 real changes made)

. 
. bysort indx: egen authorsp1=count(empcode!=.) if phase==0 //count the number of authors
(19713 missing values generated)

. bysort indx: egen authorsp2=count(empcode!=.) if phase==1 //count the number of authors
(14772 missing values generated)

. bysort indx: egen authorsp3=count(empcode!=.) if phase==2 //count the number of authors
(17341 missing values generated)

. 
. 
. foreach var of varlist age tenure male salary creative {
  2. gen `var'p1=.
  3. replace `var'p1=`var' if phase==0
  4. gen `var'p2=.
  5. replace `var'p2=`var' if phase==1
  6. gen `var'p3=.
  7. replace `var'p3=`var' if phase==2
  8. }
(25,913 missing values generated)
(5,960 real changes made)
(25,913 missing values generated)
(11,127 real changes made)
(25,913 missing values generated)
(8,433 real changes made)
(25,913 missing values generated)
(5,917 real changes made)
(25,913 missing values generated)
(11,130 real changes made)
(25,913 missing values generated)
(8,118 real changes made)
(25,913 missing values generated)
(6,107 real changes made)
(25,913 missing values generated)
(11,137 real changes made)
(25,913 missing values generated)
(8,470 real changes made)
(25,913 missing values generated)
(5,840 real changes made)
(25,913 missing values generated)
(10,671 real changes made)
(25,913 missing values generated)
(8,193 real changes made)
(25,913 missing values generated)
(6,200 real changes made)
(25,913 missing values generated)
(11,141 real changes made)
(25,913 missing values generated)
(8,572 real changes made)

. 
. estpost3 ttest authorsp1 authorsp2 authorsp3 agep1 agep2 agep3 tenurep1 tenurep2 tenurep3 malep1 malep2 malep3 salaryp1 salaryp2
>  salaryp3 creativep1 creativep2 creativep3, by(pilot) cluster(custcode) //ttest with clustering

. 
.         #delimit ;
delimiter now ;
. esttab using "$dir\tabs\1_balancetable2.tex", nomtitle nonumbers noobs  starlevels(* .10 ** 0.05 *** .01) 
> varlabels(authorsp1 "Number of Employees Period 1" authorsp2 "Number of Employees Period 2" authorsp3 "Number of Employees Perio
> d 3" agep1 "Mean Age Period 1" agep2 "Mean Age Period 2" agep3 "Mean Age Period 3" 
> tenurep1 "Mean Tenure Period 1" tenurep2 "Mean Tenure Period 2" tenurep3 "Mean Tenure Period 3" malep1 "Share of Men Period 1" m
> alep2 "Share of Men Period 2" malep3 "Share of Men Period 3" 
> salaryp1 "Mean Salary Group Period 1" salaryp2 "Mean Salary Group Period 2" salaryp3 "Mean Salary Group Period 3" 
> creativep1 "Share of Prior Ideators in Period 1" creativep2 "Share of Prior Ideators in Period 2" creativep3 "Share of Prior Ide
> ators in Period 3")collabels("Treatment Group" "Control Group" "Combined")
> cells("mu_1(fmt(a2) star pvalue(p)) mu_2(fmt(a2)) mean(fmt(a2))" "sd_1(fmt(2)par) sd_2(fmt(2)par) sd(fmt(2)par)")
> title(Descriptive statistics) booktabs gaps replace
> postfoot("\bottomrule" "\end{tabular}" "\\ [2mm] \begin{minipage}{0.83\textwidth}" 
>         "\footnotesize" "{\it Note:} 
>         
>         Standard deviations of the means are displayed in parentheses. In each line, the difference of group means is tested    
>        with a t-test using standard errors that are clustered at client team level. ***Significant at the 1\% level; **significa
> nt at the 5\% level; *significant at the 10\% level.    \textit{Number of employees} in period 1 (pre-treatment) is based on emp
> loyment roster 1; 
>         \textit{Number of employees} in period 2 (treatment) is based on rosters 1 and 2; \textit{Number of employees} in period
>  3 (post-treatment) is based on roster 2. \textit{Age} and \textit{tenure} are measured          at the end of the respective pe
> riod.         
>         " "\end{minipage}" 
>         "\end{table}")
> ;
(output written to C:\Dropbox\GNS Creativity\india\tabs\1_balancetable2.tex)

. #delimit cr
delimiter now cr
. 
. 
. ******************
. **** Table 2: SUMMARY STATISTICS OF OUTCOME VARIABLES
. *****************
. use person-inactive.dta, clear

. eststo clear

. drop if pilot==.
(89 observations deleted)

. gen index=1

. replace index=2 if pilot==1&period2==1
(5,257 real changes made)

. replace index=3 if pilot==0&period2==0
(3,181 real changes made)

. replace index=4 if pilot==0&period2==1
(5,879 real changes made)

. 
. bysort custcode period: gen num=_n

. bysort index: egen sumofideas=sum(amountideas) //compute sum of ideas

. pooledvar active, by1(custcode period2) by2(pilot period2) //compute mean of means and pooled standard deviation

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                            17,330  
    -----------------------------------------

. 
. eststo: estpost tabstat index, listwise statistics(mean) columns(statistics) casewise nototal by(index)

Summary statistics: mean
     for variables: index
  by categories of: index

       index |   e(mean) 
-------------+-----------
           1 |         1 
           2 |         2 
           3 |         3 
           4 |         4 
(est1 stored)

. eststo: estpost tabstat sumofideas, listwise statistics(mean) columns(statistics) casewise nototal by(index)

Summary statistics: mean
     for variables: sumofideas
  by categories of: index

       index |   e(mean) 
-------------+-----------
           1 |       517 
           2 |       566 
           3 |       361 
           4 |       363 
(est2 stored)

. eststo: estpost tabstat activemeanofmean if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by(index) 
> //active, mean of means Ideator (=active employee)

Summary statistics: mean sd
     for variables: activemeanofmean
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .1949302          0 
           2 |  .0829557          0 
           3 |  .3363578          0 
           4 |  .1115542          0 
(est3 stored)

. eststo: estpost tabstat activepooledsd if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by(index) //
> active, pooled sd Ideator

Summary statistics: mean sd
     for variables: activepooledsd
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .3550035          0 
           2 |  .2640657          0 
           3 |    .28456          0 
           4 |  .2040623          0 
(est4 stored)

. 
. 
. use idealevel.dta, clear //each observation is an author-idea

. duplicates drop ideaid, force //now each observation is one idea

Duplicates in terms of ideaid

(1,017 observations deleted)

. gen index=1 //treatment period 1 (pre-treatment period)

. replace index=2 if pilot==1&period2==1 //treatment period 2 (treatment period)
(566 real changes made)

. replace index=3 if pilot==0&period2==0 //control period 1
(361 real changes made)

. replace index=4 if pilot==0&period2==1 //control period 2
(363 real changes made)

. 
. bysort custcode period finished: gen num=_n

. gen implementedfin=implemented

. replace implementedfin=. if finished==0
(644 real changes made, 644 to missing)

. gen sharedfin=shared*finished

. replace sharedfin=. if finished==0
(644 real changes made, 644 to missing)

. pooledvar implementedfin, by1(custcode period2) by2(pilot period2) //compute mean of means and pooled standard deviation

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                             1,807  
    -----------------------------------------

. pooledvar sharedfin, by1(custcode period2) by2(pilot period2) //compute mean of means and pooled standard deviation

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                             1,807  
    -----------------------------------------

. 
. eststo: estpost tabstat NumAuthors, listwise statistics(mean sd) columns(statistics) casewise nototal by(index) //Authors (numbe
> r of authors per idea)

Summary statistics: mean sd
     for variables: NumAuthors
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  1.715667   .8926955 
           2 |  1.309187   .5499674 
           3 |  1.903047   1.117545 
           4 |  1.402204   .6674728 
(est5 stored)

. eststo: estpost tabstat finished, listwise statistics(mean sd) columns(statistics) casewise nototal by(index) //Finished (indica
> tor whether idea is finished)

Summary statistics: mean sd
     for variables: finished
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .7446809   .4364628 
           2 |  .6431095   .4795059 
           3 |   .634349   .4822807 
           4 |  .5096419    .500597 
(est6 stored)

. eststo: estpost tabstat implementedfinmeanofmean if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by
> (index) //mean of means Imp|Fin

Summary statistics: mean sd
     for variables: implementedfinmeanofmean
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .4099088          0 
           2 |  .5164264          0 
           3 |  .6383987          0 
           4 |  .7122273          0 
(est7 stored)

. eststo: estpost tabstat implementedfinpooledsd if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by(i
> ndex) //pooled sd Imp|Fin

Summary statistics: mean sd
     for variables: implementedfinpooledsd
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .3794831          0 
           2 |  .4611714          0 
           3 |   .249277          0 
           4 |  .3664543          0 
(est8 stored)

. eststo: estpost tabstat sharedfinmeanofmean if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by(inde
> x) //mean of means Shared|Fin

Summary statistics: mean sd
     for variables: sharedfinmeanofmean
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |   .449255          0 
           2 |  .5967737          0 
           3 |  .4146825          0 
           4 |  .3392669          0 
(est9 stored)

. eststo: estpost tabstat sharedfinpooledsd if num==1, listwise statistics(mean sd) columns(statistics) casewise nototal by(index)
>  //pooled sd Shared|Fin

Summary statistics: mean sd
     for variables: sharedfinpooledsd
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  .4400439          0 
           2 |  .4495401          0 
           3 |  .3978432          0 
           4 |  .4462879          0 
(est10 stored)

. eststo: estpost tabstat lognetgain, listwise statistics(mean sd) columns(statistics) casewise nototal by(index)

Summary statistics: mean sd
     for variables: lognetgain
  by categories of: index

       index |   e(mean)      e(sd) 
-------------+----------------------
           1 |  8.704768   2.029896 
           2 |  9.427651   2.023312 
           3 |  8.864981   2.082978 
           4 |  9.257032   2.145568 
(est11 stored)

. *some manual editing is required to get these numbers into the table of the paper
. 
. 
. *******************************
. * TABLE 3: WHO IDEATES?
. *******************************
. use person-inactive.dta, clear

. global a c.age##c.age c.tenure##c.tenure i.male i.salary01 i.salary2 i.salary3

. global c age tenure male salary01 salary2 salary3

. 
. eststo clear

. logit active $a  customer1-customer19 if period2==0, cluster(custcode)

note: customer16 != 0 predicts success perfectly
      customer16 dropped and 29 obs not used

note: customer19 omitted because of collinearity
Iteration 0:   log pseudolikelihood = -1725.3092  
Iteration 1:   log pseudolikelihood = -1538.6183  
Iteration 2:   log pseudolikelihood = -1440.9037  
Iteration 3:   log pseudolikelihood = -1428.2831  
Iteration 4:   log pseudolikelihood = -1423.1389  
Iteration 5:   log pseudolikelihood = -1417.4962  
Iteration 6:   log pseudolikelihood = -1416.5336  
Iteration 7:   log pseudolikelihood = -1416.5328  
Iteration 8:   log pseudolikelihood = -1416.5328  

Logistic regression                             Number of obs     =      5,887
                                                Wald chi2(7)      =          .
                                                Prob > chi2       =          .
Log pseudolikelihood = -1416.5328               Pseudo R2         =     0.1790

                                   (Std. Err. adjusted for 18 clusters in custcode)
-----------------------------------------------------------------------------------
                  |               Robust
           active |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
              age |  -.0376175   .1133791    -0.33   0.740    -.2598364    .1846015
                  |
      c.age#c.age |  -.0011104   .0018002    -0.62   0.537    -.0046386    .0024179
                  |
           tenure |   .5067183   .1190299     4.26   0.000     .2734241    .7400126
                  |
c.tenure#c.tenure |   -.027409   .0120008    -2.28   0.022      -.05093   -.0038879
                  |
           1.male |   .0667504   .1341127     0.50   0.619    -.1961057    .3296065
       1.salary01 |  -1.265856   .4666994    -2.71   0.007     -2.18057   -.3511415
        1.salary2 |   .0793154   .4909178     0.16   0.872    -.8828659    1.041497
        1.salary3 |   .8807001   .4441975     1.98   0.047     .0100891    1.751311
        customer1 |  -.3561928    .049397    -7.21   0.000    -.4530092   -.2593764
        customer2 |   .9656406   .0539497    17.90   0.000     .8599011     1.07138
        customer3 |    1.41439   .0551666    25.64   0.000     1.306265    1.522514
        customer4 |  -.2321198   .0246221    -9.43   0.000    -.2803782   -.1838613
        customer5 |   .5626164   .0460358    12.22   0.000      .472388    .6528449
        customer6 |  -.5917169   .0424246   -13.95   0.000    -.6748675   -.5085663
        customer7 |   .2232233    .047526     4.70   0.000      .130074    .3163725
        customer8 |   2.695092   .0818863    32.91   0.000     2.534598    2.855586
        customer9 |  -.2497311   .0226994   -11.00   0.000    -.2942212    -.205241
       customer10 |  -.5150077   .0602615    -8.55   0.000    -.6331182   -.3968973
       customer11 |   1.579141   .0609527    25.91   0.000     1.459676    1.698606
       customer12 |   1.602129   .0654757    24.47   0.000     1.473799    1.730459
       customer13 |  -.0042121   .0332184    -0.13   0.899    -.0693189    .0608946
       customer14 |  -.1915661   .0785489    -2.44   0.015    -.3455192   -.0376131
       customer15 |   .5294093   .0810148     6.53   0.000     .3706232    .6881954
       customer16 |          0  (omitted)
       customer17 |  -.9423691   .0232781   -40.48   0.000    -.9879935   -.8967448
       customer18 |   .3084619   .0605717     5.09   0.000     .1897436    .4271802
       customer19 |          0  (omitted)
            _cons |  -.8062016    1.79366    -0.45   0.653    -4.321711    2.709308
-----------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =      5,887
Model VCE    : Robust

Expression   : Pr(active), predict()
dy/dx w.r.t. : age tenure 1.male 1.salary01 1.salary2 1.salary3

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.0070867   .0014748    -4.81   0.000    -.0099771   -.0041962
      tenure |   .0182243   .0028751     6.34   0.000     .0125892    .0238594
      1.male |   .0044436   .0088283     0.50   0.615    -.0128596    .0217468
  1.salary01 |  -.0942868   .0388304    -2.43   0.015    -.1703929   -.0181807
   1.salary2 |   .0053995   .0337846     0.16   0.873     -.060817     .071616
   1.salary3 |    .075367   .0475957     1.58   0.113    -.0179188    .1686528
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est1 stored)

. zinb amountideasnoweight $a   customer1-customer19 if period2==0, inflate($a customer1-customer19) cluster(custcode)
note: customer19 omitted because of collinearity
note: customer19 omitted because of collinearity

Fitting constant-only model:

Iteration 0:   log pseudolikelihood = -3003.4448  (not concave)
Iteration 1:   log pseudolikelihood = -2655.4912  (not concave)
Iteration 2:   log pseudolikelihood = -2345.0692  (not concave)
Iteration 3:   log pseudolikelihood = -2275.9881  
Iteration 4:   log pseudolikelihood = -2270.6201  
Iteration 5:   log pseudolikelihood = -2231.1109  
Iteration 6:   log pseudolikelihood = -2224.9871  
Iteration 7:   log pseudolikelihood = -2220.5675  
Iteration 8:   log pseudolikelihood = -2220.3547  
Iteration 9:   log pseudolikelihood = -2220.3418  
Iteration 10:  log pseudolikelihood = -2220.3386  
Iteration 11:  log pseudolikelihood =  -2220.338  
Iteration 12:  log pseudolikelihood = -2220.3379  
Iteration 13:  log pseudolikelihood = -2220.3378  

Fitting full model:

Iteration 0:   log pseudolikelihood = -2220.3378  
Iteration 1:   log pseudolikelihood = -2213.3832  (backed up)
Iteration 2:   log pseudolikelihood =  -2182.088  
Iteration 3:   log pseudolikelihood = -2177.7862  
Iteration 4:   log pseudolikelihood = -2177.4497  
Iteration 5:   log pseudolikelihood = -2177.4454  
Iteration 6:   log pseudolikelihood = -2177.4454  

Zero-inflated negative binomial regression      Number of obs     =      5,916
                                                Nonzero obs       =        535
                                                Zero obs          =      5,381

Inflation model      = logit                    Wald chi2(26)     =          .
Log pseudolikelihood = -2177.445                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
                age |  -.0131862   .2731558    -0.05   0.961    -.5485616    .5221893
                    |
        c.age#c.age |  -.0001607    .004194    -0.04   0.969    -.0083807    .0080593
                    |
             tenure |  -.1491166    .151875    -0.98   0.326     -.446786    .1485528
                    |
  c.tenure#c.tenure |   .0004457   .0078757     0.06   0.955    -.0149904    .0158818
                    |
             1.male |    -.48472   .1804749    -2.69   0.007    -.8384443   -.1309956
         1.salary01 |  -1.789164   .8734101    -2.05   0.041    -3.501017   -.0773119
          1.salary2 |  -1.175067   .5886272    -2.00   0.046    -2.328755   -.0213793
          1.salary3 |  -.9676414   .3530286    -2.74   0.006    -1.659565   -.2757182
          customer1 |   1.244238   .4217406     2.95   0.003     .4176414    2.070834
          customer2 |   .2900313   .4198672     0.69   0.490    -.5328933    1.112956
          customer3 |   1.007783   .3769692     2.67   0.008     .2689368    1.746629
          customer4 |   .2792388   .2159709     1.29   0.196    -.1440564     .702534
          customer5 |   .7849564   .3999399     1.96   0.050     .0010886    1.568824
          customer6 |  -.1681987   .5450915    -0.31   0.758    -1.236558    .9001609
          customer7 |  -.5427086    .400931    -1.35   0.176    -1.328519    .2431018
          customer8 |   1.484681   .4392838     3.38   0.001     .6237009    2.345662
          customer9 |   .0384697   .2223441     0.17   0.863    -.3973168    .4742562
         customer10 |   .6977035   .1846623     3.78   0.000     .3357721    1.059635
         customer11 |    1.07388    .482059     2.23   0.026     .1290616    2.018698
         customer12 |   .7583787   .5451819     1.39   0.164    -.3101582    1.826916
         customer13 |  -.5237402   .4089626    -1.28   0.200    -1.325292    .2778118
         customer14 |  -.6635209   .1484412    -4.47   0.000    -.9544602   -.3725815
         customer15 |    1.29767   .5042982     2.57   0.010     .3092641    2.286077
         customer16 |   .6331709   .2973802     2.13   0.033     .0503164    1.216025
         customer17 |   .4073106   .2672228     1.52   0.127    -.1164364    .9310576
         customer18 |   .9743575   .2112178     4.61   0.000     .5603782    1.388337
         customer19 |          0  (omitted)
              _cons |   2.374471   4.426597     0.54   0.592      -6.3015    11.05044
--------------------+----------------------------------------------------------------
inflate             |
                age |   .0665041   .2582881     0.26   0.797    -.4397312    .5727394
                    |
        c.age#c.age |   .0008661   .0040378     0.21   0.830    -.0070479    .0087801
                    |
             tenure |  -.7454564   .2208281    -3.38   0.001    -1.178272   -.3126412
                    |
  c.tenure#c.tenure |   .0253396     .01052     2.41   0.016     .0047209    .0459583
                    |
             1.male |  -.4375704   .1976956    -2.21   0.027    -.8250467    -.050094
         1.salary01 |   .2508569   .7832277     0.32   0.749    -1.284241    1.785955
          1.salary2 |  -1.157149   .9548932    -1.21   0.226    -3.028705    .7144078
          1.salary3 |   -2.33388   .7517603    -3.10   0.002    -3.807303   -.8604565
          customer1 |   1.608324   .6004509     2.68   0.007     .4314618    2.785186
          customer2 |  -1.465291   .2777082    -5.28   0.000    -2.009589    -.920993
          customer3 |  -.9231212    .410408    -2.25   0.024    -1.727506   -.1187363
          customer4 |   .3508688   .2335945     1.50   0.133    -.1069681    .8087057
          customer5 |   .0716566   .4292398     0.17   0.867    -.7696379    .9129511
          customer6 |   .2039964   .5153727     0.40   0.692    -.8061155    1.214108
          customer7 |  -1.311281    .481987    -2.72   0.007    -2.255958    -.366604
          customer8 |  -2.405745   .2503577    -9.61   0.000    -2.896437   -1.915053
          customer9 |   .4027531    .274405     1.47   0.142    -.1350708     .940577
         customer10 |   1.395089   .3771352     3.70   0.000      .655918    2.134261
         customer11 |  -1.358643   .3894006    -3.49   0.000    -2.121854   -.5954319
         customer12 |  -2.093343   .3826243    -5.47   0.000    -2.843273   -1.343413
         customer13 |  -.7525215   .3879743    -1.94   0.052    -1.512937    .0078941
         customer14 |  -.3138702   .1562459    -2.01   0.045    -.6201064   -.0076339
         customer15 |   .6872636   .5704932     1.20   0.228    -.4308826     1.80541
         customer16 |  -21.42419    1.54925   -13.83   0.000    -24.46066   -18.38771
         customer17 |    1.66358   .4125398     4.03   0.000     .8550163    2.472143
         customer18 |   .4456059   .2822199     1.58   0.114     -.107535    .9987468
         customer19 |          0  (omitted)
              _cons |   .8236543   3.956478     0.21   0.835      -6.9309    8.578209
--------------------+----------------------------------------------------------------
           /lnalpha |   .2531664   .6219892     0.41   0.684      -.96591    1.472243
--------------------+----------------------------------------------------------------
              alpha |   1.288098   .8011828                      .3806367    4.359001
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =      5,916
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : age tenure 1.male 1.salary01 1.salary2 1.salary3

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.0169793   .0044913    -3.78   0.000     -.025782   -.0081766
      tenure |   .0299654    .009485     3.16   0.002     .0113752    .0485556
      1.male |  -.0561671   .0416799    -1.35   0.178    -.1378583    .0255241
  1.salary01 |  -.5164136    .290618    -1.78   0.076    -1.086014    .0531873
   1.salary2 |  -.1186728    .099663    -1.19   0.234    -.3140087    .0766631
   1.salary3 |   .0217258   .0740611     0.29   0.769    -.1234313    .1668829
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est2 stored)

. xtpoisson amountideasnoweight $a  if period2==0, fe i(custcode) vce(robust) //quasi maximum likelihood poisson (robust sandwich 
> estimator for SE)

Iteration 0:   log pseudolikelihood = -3350.8691  
Iteration 1:   log pseudolikelihood = -2983.6248  
Iteration 2:   log pseudolikelihood = -2955.4373  
Iteration 3:   log pseudolikelihood = -2954.9278  
Iteration 4:   log pseudolikelihood = -2954.9273  
Iteration 5:   log pseudolikelihood = -2954.9273  

Conditional fixed-effects Poisson regression    Number of obs     =      5,916
Group variable: custcode                        Number of groups  =         19

                                                Obs per group:
                                                              min =         20
                                                              avg =      311.4
                                                              max =      2,460

                                                Wald chi2(8)      =     210.69
Log pseudolikelihood  = -2954.9273              Prob > chi2       =     0.0000

                                      (Std. Err. adjusted for clustering on custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
                age |  -.1125036   .1133524    -0.99   0.321    -.3346702     .109663
                    |
        c.age#c.age |   .0005443   .0016578     0.33   0.743    -.0027049    .0037935
                    |
             tenure |   .5083331   .1012744     5.02   0.000      .309839    .7068272
                    |
  c.tenure#c.tenure |  -.0337886   .0096098    -3.52   0.000    -.0526235   -.0149537
                    |
             1.male |  -.2982206   .2209299    -1.35   0.177    -.7312353    .1347941
         1.salary01 |   -1.30832   .4077335    -3.21   0.001    -2.107463   -.5091768
          1.salary2 |   .0090588    .338787     0.03   0.979    -.6549515    .6730691
          1.salary3 |   .5309511   .4290626     1.24   0.216    -.3099961    1.371898
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =      5,916
Model VCE    : Robust

Expression   : Linear prediction, predict()
dy/dx w.r.t. : age tenure 1.male 1.salary01 1.salary2 1.salary3

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.0801978   .0234005    -3.43   0.001     -.126062   -.0343337
      tenure |   .3095376   .0585493     5.29   0.000     .1947831    .4242921
      1.male |  -.2982206   .2209299    -1.35   0.177    -.7312353    .1347941
  1.salary01 |   -1.30832   .4077335    -3.21   0.001    -2.107463   -.5091768
   1.salary2 |   .0090588    .338787     0.03   0.979    -.6549515    .6730691
   1.salary3 |   .5309511   .4290626     1.24   0.216    -.3099961    1.371898
------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est3 stored)

. 
. 
. 
.         #delimit ;
delimiter now ;
.         esttab using "$dir\tabs\3_who-ideates.tex", 
>         cells(b(star fmt(%9.3f)) se(par fmt(%9.3f) )) starlevels(* .10 ** 0.05 *** .01) 
>         stats(ll N_clust N, fmt(%9.2f %9.0f %9.0f) labels("Log Pseudo likelihood" Clusters Observations))
>         keep(age  tenure  1.male  1.salary01 1.salary2 1.salary3) 
>         order(NumAuthors age agesquare tenure tenuresquare 1.male 1.experience 1.salary01 1.salary2 1.salary3 period2)
>         varlabels(age Age NumAuthors "Number of Authors" agesquare Age$^2$ tenure Tenure tenuresquare Tenure$^2$ 1.male Male log
> cost "Log(Cost)" logprojectedvalue "Log(Value)" 1.experience "Submitted Idea Previously"
>         1.salary01 "Salary Groups 0 \& 1 pooled" 1.salary3 "Salary Group 3" 1.salary2 "Salary Group 2",
>         elist(NumAuthors "[2mm]" age "[2mm]" agesquare "[2mm]" tenure "[2mm]" tenuresquare "[2mm]" 1.male "[2mm]" logprojectedva
> lue "[2mm]" logcost "[2mm]" 1.experience  "[2mm]" 1.salary01 "[2mm]" 1.salary2 "[2mm]" 1.salary3  "\midrule  
>          Client FE  &yes & yes &yes   \\ " )) 
>          nonumbers collabels(,none) mlabels("\specialcell{(1) Logit  AME \\}"  
>         "\specialcell{(2)  ZINB AME \\}" "\specialcell{(3) QML Poisson AME \\}") 
>         prehead("\begin{table}[h]%" "\small" "\caption{Who ideates? Influence of employee characteristics on ideation}%" 
>         "\begin{center}%" "\begin{tabular}{lccc}" 
>         "\toprule") posthead("[3mm] Dependent variable &  Ideator & Number of Ideas & Number of Ideas \\" "\midrule")  prefoot("
> ") 
>         postfoot("\bottomrule" "\end{tabular}" "\\ [2mm] \begin{minipage}{\textwidth}" 
>         "\footnotesize" "{\it Note:} 
>         
>         The regressions use data from the pre-treatment period only, where both groups have identical incentives.   
>         \textit{Ideator} is a dummy indicating whether an employee submitted at least one idea in the given period.      
>         \textit{Number of Ideas} is the number of ideas submitted within the 13  pre-treatment months.       
>         \textit{Salary group} is an indicator for an employee's position in the company          hierarchy.   
>         The reference category is (upper) management, that is, salary groups 4 and above. The marginal effects          
>         of \textit{Age} and \textit{Tenure} are based on linear and quadratic terms. Standard errors are clustered at the client
>           
>         team level.          ***Significant at the 1\% level; **significant at the 5\% level; *significant at the 10\% level.   
>                         
>         
>         " "\end{minipage}" 
>         "\end{center}" "\end{table}") style(tex) replace
> ;
(output written to C:\Dropbox\GNS Creativity\india\tabs\3_who-ideates.tex)

. #delimit cr
delimiter now cr
. 
. 
. ********************************
. **** Table 4: IDEA QUANTITY
. *********************************
. *Marginal effect of interaction is computed manually, because ZINB model is nonlinear, see
. *Norton & Ai (2003): Interaction terms in logit and probit models, Economics Letters.
. 
. *1. average marginal effect logit: switch on and off both dummy of treatment and creativetreatmentper2 (effect on prior ideators
> )
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8133509     0.94   0.348    -.8304681    2.357809
               creative |  -20.58686    .699979   -29.41   0.000    -21.95879   -19.21492
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5883595    32.57   0.000     18.00892    20.31524
      creativetreatment |  -1.087302   .8908035    -1.22   0.222    -2.833245    .6586409
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. drop if e(sample)!=1
(374 observations deleted)

. transform
Note: cannot guarantee correctness if there is collinearity in the zinb model!
Warning: many options have been hard-coded; if you're running zinb with nondefault
options, you might want to check that those carry over.
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a Logit model (cmd logit) has been estimated with the
parameters of the inflate process of the zero inflated model.
Note that the point estimates have been inverted, so that a positive sign represents a positive effect.

. replace treatmentper2=1
(11,792 real changes made)

. replace creativetreatmentper2=1
(16,788 real changes made)

. predict double withtreat
(option pr assumed; Pr(inflate))

. predict double withtreatlin, xb

. replace treatmentper2=0
(17,045 real changes made)

. replace creativetreatmentper2=0
(17,045 real changes made)

. predict double withouttreat
(option pr assumed; Pr(inflate))

. predict double withouttreatlin, xb

. gen me=withtreat-withouttreat

. sum me //average marginal effect; treatment effect on prior ideators

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          me |     17,045    .0025515    .0022462   8.00e-12   .0097623

. scalar numvar=(e(k)-1)/2

. mat diff = J(numvar, 1, .)

. local index=1

. foreach varname of varlist treatmentper2 treatmentper2 creativetreatmentper2 creativetreatmentper2 creative period2 creativeperi
> od2 creativetreatment age agesquare tenure tenuresquare male male salary01 salary2 salary3 salary4plus salaryother customer1-cus
> tomer18 {
  2. if `index'==2|`index'==4 {
  3.         //switch on and off
.         gen differential`index'=1*exp(withtreatlin)/(1+exp(withtreatlin))^2-0*exp(withouttreatlin)/(1+exp(withouttreatlin))^2
  4. }
  5. else if `index'==1|`index'==3|`index'==13 {
  6.         gen differential`index'=0
  7. }
  8. else {
  9.         gen differential`index'=`varname'*exp(withtreatlin)/(1+exp(withtreatlin))^2-`varname'*exp(withouttreatlin)/(1+exp(wit
> houttreatlin))^2
 10. }
 11. quietly sum differential`index'
 12. mat diff[`index',1]=r(mean)
 13. local index=`index'+1
 14. }

. mat AVAR=diff'*e(V)*diff

. disp sqrt(AVAR[1,1]) //standard error of treatment effect (delta method)
.05465453

. 
. 
. *2. average marginal effect logit: switch on and off only treatment (effect on rest)
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8234723     0.93   0.354    -.8503058    2.377646
               creative |  -20.58686   .6931484   -29.70   0.000     -21.9454   -19.22831
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5802164    33.03   0.000     18.02488    20.29928
      creativetreatment |  -1.087302   .8908035    -1.22   0.222    -2.833245    .6586409
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. drop if e(sample)!=1
(374 observations deleted)

. transform
Note: cannot guarantee correctness if there is collinearity in the zinb model!
Warning: many options have been hard-coded; if you're running zinb with nondefault
options, you might want to check that those carry over.
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a Logit model (cmd logit) has been estimated with the
parameters of the inflate process of the zero inflated model.
Note that the point estimates have been inverted, so that a positive sign represents a positive effect.

. replace treatmentper2=1
(11,792 real changes made)

. replace creativetreatmentper2=0
(257 real changes made)

. predict double withtreat
(option pr assumed; Pr(inflate))

. predict double withtreatlin, xb

. replace treatmentper2=0
(17,045 real changes made)

. predict double withouttreat
(option pr assumed; Pr(inflate))

. predict double withouttreatlin, xb

. gen me=withtreat-withouttreat

. sum me //treatment effect on all but prior ideators

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          me |     17,045    .0652448     .048205   1.15e-10   .1980283

. scalar numvar=(e(k)-1)/2

. mat diff = J(numvar, 1, .)

. local index=1

. foreach varname of varlist treatmentper2 treatmentper2 creativetreatmentper2 creativetreatmentper2 creative period2 creativeperi
> od2 creativetreatment age agesquare tenure tenuresquare male male salary01 salary2 salary3 salary4plus salaryother customer1-cus
> tomer18 {
  2. if `index'==2 {
  3.         //switch on and off
.         gen differential`index'=1*exp(withtreatlin)/(1+exp(withtreatlin))^2-0*exp(withouttreatlin)/(1+exp(withouttreatlin))^2
  4. }
  5. else if `index'==1|`index'==3|`index'==13 {
  6.         gen differential`index'=0
  7. }
  8. else {
  9.         gen differential`index'=`varname'*exp(withtreatlin)/(1+exp(withtreatlin))^2-`varname'*exp(withouttreatlin)/(1+exp(wit
> houttreatlin))^2
 10. }
 11. quietly sum differential`index'
 12. mat diff[`index',1]=r(mean)
 13. local index=`index'+1
 14. }

. mat AVAR=diff'*e(V)*diff

. disp sqrt(AVAR[1,1]) //SE of treatment effect
.01939639

. 
. 
. *3. average marginal effect NB: switch on and off only treatment (effect on rest)
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8273153     0.92   0.356    -.8578379    2.385178
               creative |  -20.58686   .6931484   -29.70   0.000     -21.9454   -19.22831
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5829434    32.87   0.000     18.01953    20.30463
      creativetreatment |  -1.087302   .8954409    -1.21   0.225    -2.842334      .66773
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. drop if e(sample)!=1
(374 observations deleted)

. transform2
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a NB2 model (cmd nbreg) has been estimated with the
parameters of the nbreg process of the zero inflated model.

. replace treatmentper2=1
(11,792 real changes made)

. replace creativetreatmentper2=0
(257 real changes made)

. predict double withtreat
(option n assumed; predicted number of events)

. predict double withtreatlin, xb

. replace treatmentper2=0
(17,045 real changes made)

. predict double withouttreat
(option n assumed; predicted number of events)

. predict double withouttreatlin, xb

. gen me=withtreat-withouttreat

. sum me //treatment effect on all but prior ideators

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          me |     17,045   -.7617632    .5579938  -22.15162  -.0006255

. scalar numvar=(e(k)-1)/2

. mat diff = J(numvar, 1, .)

. local index=1

. foreach varname of varlist treatmentper2 treatmentper2 creativetreatmentper2 creativetreatmentper2 creative period2 creativeperi
> od2 creativetreatment age agesquare tenure tenuresquare male male salary01 salary2 salary3 salary4plus salaryother customer1-cus
> tomer18 {
  2. if `index'==2 {
  3.         //switch on and off
.         gen differential`index'=1*exp(withtreatlin)-0*exp(withouttreatlin)
  4. }
  5. else if `index'==1|`index'==3|`index'==13 {
  6.         gen differential`index'=0
  7. }
  8. else {
  9.         gen differential`index'=`varname'*exp(withtreatlin)-`varname'*exp(withouttreatlin)
 10. }
 11. quietly sum differential`index'
 12. mat diff[`index',1]=r(mean)
 13. local index=`index'+1
 14. }

. mat AVAR=diff'*e(V)*diff

. disp sqrt(AVAR[1,1]) //SE
.28075919

. 
. 
. *4. average marginal effect NB: switch on and off both dummy of treatment and creativetreatmentper2 (effect on prior ideators)
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8015659     0.95   0.341      -.80737    2.334711
               creative |  -20.58686   .6954327   -29.60   0.000    -21.94988   -19.22383
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208    .591049    32.42   0.000     18.00365    20.32052
      creativetreatment |  -1.087302   .8908035    -1.22   0.222    -2.833245    .6586409
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. drop if e(sample)!=1
(374 observations deleted)

. transform2
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a NB2 model (cmd nbreg) has been estimated with the
parameters of the nbreg process of the zero inflated model.

. replace treatmentper2=1
(11,792 real changes made)

. replace creativetreatmentper2=1
(16,788 real changes made)

. predict double withtreat
(option n assumed; predicted number of events)

. predict double withtreatlin, xb

. replace treatmentper2=0
(17,045 real changes made)

. replace creativetreatmentper2=0
(17,045 real changes made)

. predict double withouttreat
(option n assumed; predicted number of events)

. predict double withouttreatlin, xb

. gen me=withtreat-withouttreat

. sum me //treatment effect

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          me |     17,045   -.2074347    .1519465  -6.032078  -.0001703

. scalar numvar=(e(k)-1)/2

. mat diff = J(numvar, 1, .)

. local index=1

. foreach varname of varlist treatmentper2 treatmentper2 creativetreatmentper2 creativetreatmentper2 creative period2 creativeperi
> od2 creativetreatment age agesquare tenure tenuresquare male male salary01 salary2 salary3 salary4plus salaryother customer1-cus
> tomer18 {
  2. if `index'==2|`index'==4 {
  3.         //switch on and off
.         gen differential`index'=1*exp(withtreatlin)-0*exp(withouttreatlin)
  4. }
  5. else if `index'==1|`index'==3|`index'==13 {
  6.         gen differential`index'=0
  7. }
  8. else {
  9.         gen differential`index'=`varname'*exp(withtreatlin)-`varname'*exp(withouttreatlin)
 10. }
 11. quietly sum differential`index'
 12. mat diff[`index',1]=r(mean)
 13. local index=`index'+1
 14. }

. mat AVAR=diff'*e(V)*diff

. disp sqrt(AVAR[1,1]) //SE of treatment effect
.33122001

. 
. 
. *5. OVERALL ME/TREATMENT EFFECT (number of ideas)
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8043085     0.95   0.342    -.8127455    2.340086
               creative |  -20.58686   .6965721   -29.55   0.000    -21.95211    -19.2216
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5870102    32.64   0.000     18.01156     20.3126
      creativetreatment |  -1.087302   .8789537    -1.24   0.216    -2.810019    .6354157
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. drop if e(sample)!=1
(374 observations deleted)

. replace treatmentper2=1
(11,792 real changes made)

. replace creativetreatmentper2=0
(257 real changes made)

. predict double withtreat
(option n assumed; predicted number of events)

. replace treatmentper2=0
(17,045 real changes made)

. predict double withouttreat
(option n assumed; predicted number of events)

. gen me=withtreat-withouttreat

. sum me

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
          me |     17,045   -.0529873    .2186627  -3.903465  -1.17e-06

. 
. 
. use person-inactive.dta, clear

. gen creativeperiod2=creative*period2
(89 missing values generated)

. gen creativetreatment=creative*pilot
(89 missing values generated)

. global b i.treatmentper2 i.creativetreatmentper2 creative period2 creativeperiod2 creativetreatment c.age##c.age c.tenure##c.ten
> ure i.male salary01 salary2 salary3 salary4plus salaryother

. global d treatmentper2 creativetreatmentper2 age tenure male

. global a i.treatmentper2 period2 c.age##c.age c.tenure##c.tenure i.male salary01 salary2 salary3 salary4plus salaryother

. global c treatmentper2 age tenure male

. 
.         eststo clear

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -65227.579  
Iteration 1:   log likelihood = -8793.0233  
Iteration 2:   log likelihood = -7276.2867  
Iteration 3:   log likelihood = -7093.9525  
Iteration 4:   log likelihood =  -7077.895  
Iteration 5:   log likelihood = -7077.5807  
Iteration 6:   log likelihood = -7077.5801  

Iteration 0:   log likelihood =   -6091.86  (not concave)
Iteration 1:   log likelihood = -5470.6997  
Iteration 2:   log likelihood =  -5453.724  
Iteration 3:   log likelihood = -5453.5789  
Iteration 4:   log likelihood = -5453.5789  

Fitting full model:

Iteration 0:   log pseudolikelihood = -5714.7499  
Iteration 1:   log pseudolikelihood = -5346.3824  (not concave)
Iteration 2:   log pseudolikelihood = -5305.2763  
Iteration 3:   log pseudolikelihood = -5275.4707  
Iteration 4:   log pseudolikelihood = -5266.4819  
Iteration 5:   log pseudolikelihood = -5266.2214  
Iteration 6:   log pseudolikelihood =  -5266.218  
Iteration 7:   log pseudolikelihood =  -5266.218  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(30)     =          .
Log pseudolikelihood = -5266.218                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.6032288   .3493984    -1.73   0.084    -1.288037    .0815795
            period2 |  -.3122325   .3239822    -0.96   0.335     -.947226    .3227609
                age |  -.0846337    .145307    -0.58   0.560    -.3694302    .2001627
                    |
        c.age#c.age |   .0012867    .002266     0.57   0.570    -.0031546    .0057281
                    |
             tenure |   .0577646   .1080567     0.53   0.593    -.1540227     .269552
                    |
  c.tenure#c.tenure |  -.0076133   .0083355    -0.91   0.361    -.0239505     .008724
                    |
             1.male |  -.2995965   .1363185    -2.20   0.028    -.5667758   -.0324173
           salary01 |   1.158752   2.302054     0.50   0.615    -3.353191    5.670695
            salary2 |   1.610684   2.403434     0.67   0.503    -3.099961    6.321329
            salary3 |   1.430521   2.334471     0.61   0.540    -3.144957       6.006
        salary4plus |   2.144561   2.263952     0.95   0.344    -2.292704    6.581826
        salaryother |  -4.389903   2.773858    -1.58   0.114    -9.826564    1.046758
          customer1 |   .6913793   .2270474     3.05   0.002     .2463745    1.136384
          customer2 |  -.4938652   .2871188    -1.72   0.085    -1.056608    .0688773
          customer3 |  -.7898476   .2990483    -2.64   0.008    -1.375971   -.2037236
          customer4 |  -.3703273   .1807786    -2.05   0.041    -.7246468   -.0160079
          customer5 |   .6479128   .2108018     3.07   0.002     .2347489    1.061077
          customer6 |  -.3355005   .2136304    -1.57   0.116    -.7542084    .0832073
          customer7 |  -.4389223   .3275293    -1.34   0.180    -1.080868    .2030234
          customer8 |   .4485962   .2819662     1.59   0.112    -.1040473     1.00124
          customer9 |  -.6860646   .1507852    -4.55   0.000    -.9815981   -.3905311
         customer10 |  -.2372944   .2208731    -1.07   0.283    -.6701977    .1956088
         customer11 |  -.1303012   .2835144    -0.46   0.646    -.6859792    .4253768
         customer12 |  -.0922131   .3442533    -0.27   0.789    -.7669373     .582511
         customer13 |  -1.153583   .3290328    -3.51   0.000    -1.798475   -.5086903
         customer14 |  -.5830572    .327533    -1.78   0.075     -1.22501    .0588958
         customer15 |  -.0002622   .1904273    -0.00   0.999    -.3734929    .3729685
         customer16 |  -.5484085   .2395405    -2.29   0.022    -1.017899   -.0789179
         customer17 |  -.1435448   .2866493    -0.50   0.617    -.7053671    .4182776
         customer18 |   .0188038    .233787     0.08   0.936    -.4394103    .4770179
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322419   .3422332    -3.86   0.000    -1.993184   -.6516542
            period2 |   .5132163    .136911     3.75   0.000     .2448756    .7815569
                age |  -.3276987   .1371124    -2.39   0.017    -.5964341   -.0589633
                    |
        c.age#c.age |   .0064854   .0020919     3.10   0.002     .0023854    .0105855
                    |
             tenure |  -.7364847     .16314    -4.51   0.000    -1.056233   -.4167362
                    |
  c.tenure#c.tenure |    .038103   .0169864     2.24   0.025     .0048104    .0713957
                    |
             1.male |  -.4199237   .1009799    -4.16   0.000    -.6178408   -.2220067
           salary01 |   7.643735   2.216582     3.45   0.001     3.299314    11.98816
            salary2 |   6.639277   2.370778     2.80   0.005     1.992637    11.28592
            salary3 |    5.31927   2.375416     2.24   0.025     .6635403    9.975001
        salary4plus |   5.942415   2.045629     2.90   0.004     1.933055    9.951775
        salaryother |   .4410904   3.192137     0.14   0.890    -5.815382    6.697563
          customer1 |   .5086027   .3252377     1.56   0.118    -.1288514    1.146057
          customer2 |  -2.525811    .593362    -4.26   0.000    -3.688779   -1.362843
          customer3 |  -.5394759    .511259    -1.06   0.291    -1.541525    .4625733
          customer4 |  -.4191243   .2380119    -1.76   0.078     -.885619    .0473704
          customer5 |  -.8739687    .272772    -3.20   0.001    -1.408592   -.3393454
          customer6 |   .1031133   .3048298     0.34   0.735    -.4943421    .7005687
          customer7 |  -1.872958   .3066893    -6.11   0.000    -2.474058   -1.271858
          customer8 |  -4.452137   .5013338    -8.88   0.000    -5.434734   -3.469541
          customer9 |  -.4244316   .1854046    -2.29   0.022    -.7878179   -.0610453
         customer10 |   1.096344   .2904251     3.77   0.000     .5271216    1.665567
         customer11 |  -1.992748   .3720799    -5.36   0.000    -2.722012   -1.263485
         customer12 |  -2.744971   .7496662    -3.66   0.000     -4.21429   -1.275653
         customer13 |  -2.636557    .377118    -6.99   0.000    -3.375694   -1.897419
         customer14 |   .5378953   .5319014     1.01   0.312    -.5046124    1.580403
         customer15 |    -.72869   .2063074    -3.53   0.000    -1.133045   -.3243349
         customer16 |   -1.83378   .2671302    -6.86   0.000    -2.357345   -1.310214
         customer17 |   .8791208   .2920098     3.01   0.003     .3067921    1.451449
         customer18 |  -.6725495   .2691309    -2.50   0.012    -1.200036   -.1450627
--------------------+----------------------------------------------------------------
           /lnalpha |   1.006674   .1796159     5.60   0.000     .6546335    1.358715
--------------------+----------------------------------------------------------------
              alpha |   2.736485   .4915163                      1.924437     3.89119
-------------------------------------------------------------------------------------

. transform
Note: cannot guarantee correctness if there is collinearity in the zinb model!
Warning: many options have been hard-coded; if you're running zinb with nondefault
options, you might want to check that those carry over.
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a Logit model (cmd logit) has been estimated with the
parameters of the inflate process of the zero inflated model.
Note that the point estimates have been inverted, so that a positive sign represents a positive effect.

. eststo: estpost margins, dydx($c)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Pr(inflate), predict()
dy/dx w.r.t. : 1.treatmentper2 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1782946   .0486077     3.67   0.000     .0830253    .2735639
            age |  -.0075968    .002194    -3.46   0.001     -.011897   -.0032967
         tenure |   .0598391   .0102206     5.85   0.000     .0398071     .079871
         1.male |   .0522174    .012685     4.12   0.000     .0273553    .0770795
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est1 stored)

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -65227.579  
Iteration 1:   log likelihood = -8793.0233  
Iteration 2:   log likelihood = -7276.2867  
Iteration 3:   log likelihood = -7093.9525  
Iteration 4:   log likelihood =  -7077.895  
Iteration 5:   log likelihood = -7077.5807  
Iteration 6:   log likelihood = -7077.5801  

Iteration 0:   log likelihood =   -6091.86  (not concave)
Iteration 1:   log likelihood = -5470.6997  
Iteration 2:   log likelihood =  -5453.724  
Iteration 3:   log likelihood = -5453.5789  
Iteration 4:   log likelihood = -5453.5789  

Fitting full model:

Iteration 0:   log pseudolikelihood = -5714.7499  
Iteration 1:   log pseudolikelihood = -5346.3824  (not concave)
Iteration 2:   log pseudolikelihood = -5305.2763  
Iteration 3:   log pseudolikelihood = -5275.4707  
Iteration 4:   log pseudolikelihood = -5266.4819  
Iteration 5:   log pseudolikelihood = -5266.2214  
Iteration 6:   log pseudolikelihood =  -5266.218  
Iteration 7:   log pseudolikelihood =  -5266.218  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(30)     =          .
Log pseudolikelihood = -5266.218                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.6032288   .3493984    -1.73   0.084    -1.288037    .0815795
            period2 |  -.3122325   .3239822    -0.96   0.335     -.947226    .3227609
                age |  -.0846337    .145307    -0.58   0.560    -.3694302    .2001627
                    |
        c.age#c.age |   .0012867    .002266     0.57   0.570    -.0031546    .0057281
                    |
             tenure |   .0577646   .1080567     0.53   0.593    -.1540227     .269552
                    |
  c.tenure#c.tenure |  -.0076133   .0083355    -0.91   0.361    -.0239505     .008724
                    |
             1.male |  -.2995965   .1363185    -2.20   0.028    -.5667758   -.0324173
           salary01 |   1.158752   2.302054     0.50   0.615    -3.353191    5.670695
            salary2 |   1.610684   2.403434     0.67   0.503    -3.099961    6.321329
            salary3 |   1.430521   2.334471     0.61   0.540    -3.144957       6.006
        salary4plus |   2.144561   2.263952     0.95   0.344    -2.292704    6.581826
        salaryother |  -4.389903   2.773858    -1.58   0.114    -9.826564    1.046758
          customer1 |   .6913793   .2270474     3.05   0.002     .2463745    1.136384
          customer2 |  -.4938652   .2871188    -1.72   0.085    -1.056608    .0688773
          customer3 |  -.7898476   .2990483    -2.64   0.008    -1.375971   -.2037236
          customer4 |  -.3703273   .1807786    -2.05   0.041    -.7246468   -.0160079
          customer5 |   .6479128   .2108018     3.07   0.002     .2347489    1.061077
          customer6 |  -.3355005   .2136304    -1.57   0.116    -.7542084    .0832073
          customer7 |  -.4389223   .3275293    -1.34   0.180    -1.080868    .2030234
          customer8 |   .4485962   .2819662     1.59   0.112    -.1040473     1.00124
          customer9 |  -.6860646   .1507852    -4.55   0.000    -.9815981   -.3905311
         customer10 |  -.2372944   .2208731    -1.07   0.283    -.6701977    .1956088
         customer11 |  -.1303012   .2835144    -0.46   0.646    -.6859792    .4253768
         customer12 |  -.0922131   .3442533    -0.27   0.789    -.7669373     .582511
         customer13 |  -1.153583   .3290328    -3.51   0.000    -1.798475   -.5086903
         customer14 |  -.5830572    .327533    -1.78   0.075     -1.22501    .0588958
         customer15 |  -.0002622   .1904273    -0.00   0.999    -.3734929    .3729685
         customer16 |  -.5484085   .2395405    -2.29   0.022    -1.017899   -.0789179
         customer17 |  -.1435448   .2866493    -0.50   0.617    -.7053671    .4182776
         customer18 |   .0188038    .233787     0.08   0.936    -.4394103    .4770179
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322419   .3422332    -3.86   0.000    -1.993184   -.6516542
            period2 |   .5132163    .136911     3.75   0.000     .2448756    .7815569
                age |  -.3276987   .1371124    -2.39   0.017    -.5964341   -.0589633
                    |
        c.age#c.age |   .0064854   .0020919     3.10   0.002     .0023854    .0105855
                    |
             tenure |  -.7364847     .16314    -4.51   0.000    -1.056233   -.4167362
                    |
  c.tenure#c.tenure |    .038103   .0169864     2.24   0.025     .0048104    .0713957
                    |
             1.male |  -.4199237   .1009799    -4.16   0.000    -.6178408   -.2220067
           salary01 |   7.643735   2.216582     3.45   0.001     3.299314    11.98816
            salary2 |   6.639277   2.370778     2.80   0.005     1.992637    11.28592
            salary3 |    5.31927   2.375416     2.24   0.025     .6635403    9.975001
        salary4plus |   5.942415   2.045629     2.90   0.004     1.933055    9.951775
        salaryother |   .4410904   3.192137     0.14   0.890    -5.815382    6.697563
          customer1 |   .5086027   .3252377     1.56   0.118    -.1288514    1.146057
          customer2 |  -2.525811    .593362    -4.26   0.000    -3.688779   -1.362843
          customer3 |  -.5394759    .511259    -1.06   0.291    -1.541525    .4625733
          customer4 |  -.4191243   .2380119    -1.76   0.078     -.885619    .0473704
          customer5 |  -.8739687    .272772    -3.20   0.001    -1.408592   -.3393454
          customer6 |   .1031133   .3048298     0.34   0.735    -.4943421    .7005687
          customer7 |  -1.872958   .3066893    -6.11   0.000    -2.474058   -1.271858
          customer8 |  -4.452137   .5013338    -8.88   0.000    -5.434734   -3.469541
          customer9 |  -.4244316   .1854046    -2.29   0.022    -.7878179   -.0610453
         customer10 |   1.096344   .2904251     3.77   0.000     .5271216    1.665567
         customer11 |  -1.992748   .3720799    -5.36   0.000    -2.722012   -1.263485
         customer12 |  -2.744971   .7496662    -3.66   0.000     -4.21429   -1.275653
         customer13 |  -2.636557    .377118    -6.99   0.000    -3.375694   -1.897419
         customer14 |   .5378953   .5319014     1.01   0.312    -.5046124    1.580403
         customer15 |    -.72869   .2063074    -3.53   0.000    -1.133045   -.3243349
         customer16 |   -1.83378   .2671302    -6.86   0.000    -2.357345   -1.310214
         customer17 |   .8791208   .2920098     3.01   0.003     .3067921    1.451449
         customer18 |  -.6725495   .2691309    -2.50   0.012    -1.200036   -.1450627
--------------------+----------------------------------------------------------------
           /lnalpha |   1.006674   .1796159     5.60   0.000     .6546335    1.358715
--------------------+----------------------------------------------------------------
              alpha |   2.736485   .4915163                      1.924437     3.89119
-------------------------------------------------------------------------------------

. transform2
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a NB2 model (cmd nbreg) has been estimated with the
parameters of the nbreg process of the zero inflated model.

. eststo: estpost margins, dydx($c)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |  -.2637868   .1318846    -2.00   0.045    -.5222759   -.0052978
            age |  -.0037165   .0081325    -0.46   0.648    -.0196558    .0122229
         tenure |   .0045526   .0304397     0.15   0.881    -.0551081    .0642133
         1.male |  -.1653824   .0864047    -1.91   0.056    -.3347324    .0039677
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est2 stored)

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -65227.579  
Iteration 1:   log likelihood = -8793.0233  
Iteration 2:   log likelihood = -7276.2867  
Iteration 3:   log likelihood = -7093.9525  
Iteration 4:   log likelihood =  -7077.895  
Iteration 5:   log likelihood = -7077.5807  
Iteration 6:   log likelihood = -7077.5801  

Iteration 0:   log likelihood =   -6091.86  (not concave)
Iteration 1:   log likelihood = -5470.6997  
Iteration 2:   log likelihood =  -5453.724  
Iteration 3:   log likelihood = -5453.5789  
Iteration 4:   log likelihood = -5453.5789  

Fitting full model:

Iteration 0:   log pseudolikelihood = -5714.7499  
Iteration 1:   log pseudolikelihood = -5346.3824  (not concave)
Iteration 2:   log pseudolikelihood = -5305.2763  
Iteration 3:   log pseudolikelihood = -5275.4707  
Iteration 4:   log pseudolikelihood = -5266.4819  
Iteration 5:   log pseudolikelihood = -5266.2214  
Iteration 6:   log pseudolikelihood =  -5266.218  
Iteration 7:   log pseudolikelihood =  -5266.218  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(30)     =          .
Log pseudolikelihood = -5266.218                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.6032288   .3493984    -1.73   0.084    -1.288037    .0815795
            period2 |  -.3122325   .3239822    -0.96   0.335     -.947226    .3227609
                age |  -.0846337    .145307    -0.58   0.560    -.3694302    .2001627
                    |
        c.age#c.age |   .0012867    .002266     0.57   0.570    -.0031546    .0057281
                    |
             tenure |   .0577646   .1080567     0.53   0.593    -.1540227     .269552
                    |
  c.tenure#c.tenure |  -.0076133   .0083355    -0.91   0.361    -.0239505     .008724
                    |
             1.male |  -.2995965   .1363185    -2.20   0.028    -.5667758   -.0324173
           salary01 |   1.158752   2.302054     0.50   0.615    -3.353191    5.670695
            salary2 |   1.610684   2.403434     0.67   0.503    -3.099961    6.321329
            salary3 |   1.430521   2.334471     0.61   0.540    -3.144957       6.006
        salary4plus |   2.144561   2.263952     0.95   0.344    -2.292704    6.581826
        salaryother |  -4.389903   2.773858    -1.58   0.114    -9.826564    1.046758
          customer1 |   .6913793   .2270474     3.05   0.002     .2463745    1.136384
          customer2 |  -.4938652   .2871188    -1.72   0.085    -1.056608    .0688773
          customer3 |  -.7898476   .2990483    -2.64   0.008    -1.375971   -.2037236
          customer4 |  -.3703273   .1807786    -2.05   0.041    -.7246468   -.0160079
          customer5 |   .6479128   .2108018     3.07   0.002     .2347489    1.061077
          customer6 |  -.3355005   .2136304    -1.57   0.116    -.7542084    .0832073
          customer7 |  -.4389223   .3275293    -1.34   0.180    -1.080868    .2030234
          customer8 |   .4485962   .2819662     1.59   0.112    -.1040473     1.00124
          customer9 |  -.6860646   .1507852    -4.55   0.000    -.9815981   -.3905311
         customer10 |  -.2372944   .2208731    -1.07   0.283    -.6701977    .1956088
         customer11 |  -.1303012   .2835144    -0.46   0.646    -.6859792    .4253768
         customer12 |  -.0922131   .3442533    -0.27   0.789    -.7669373     .582511
         customer13 |  -1.153583   .3290328    -3.51   0.000    -1.798475   -.5086903
         customer14 |  -.5830572    .327533    -1.78   0.075     -1.22501    .0588958
         customer15 |  -.0002622   .1904273    -0.00   0.999    -.3734929    .3729685
         customer16 |  -.5484085   .2395405    -2.29   0.022    -1.017899   -.0789179
         customer17 |  -.1435448   .2866493    -0.50   0.617    -.7053671    .4182776
         customer18 |   .0188038    .233787     0.08   0.936    -.4394103    .4770179
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322419   .3422332    -3.86   0.000    -1.993184   -.6516542
            period2 |   .5132163    .136911     3.75   0.000     .2448756    .7815569
                age |  -.3276987   .1371124    -2.39   0.017    -.5964341   -.0589633
                    |
        c.age#c.age |   .0064854   .0020919     3.10   0.002     .0023854    .0105855
                    |
             tenure |  -.7364847     .16314    -4.51   0.000    -1.056233   -.4167362
                    |
  c.tenure#c.tenure |    .038103   .0169864     2.24   0.025     .0048104    .0713957
                    |
             1.male |  -.4199237   .1009799    -4.16   0.000    -.6178408   -.2220067
           salary01 |   7.643735   2.216582     3.45   0.001     3.299314    11.98816
            salary2 |   6.639277   2.370778     2.80   0.005     1.992637    11.28592
            salary3 |    5.31927   2.375416     2.24   0.025     .6635403    9.975001
        salary4plus |   5.942415   2.045629     2.90   0.004     1.933055    9.951775
        salaryother |   .4410904   3.192137     0.14   0.890    -5.815382    6.697563
          customer1 |   .5086027   .3252377     1.56   0.118    -.1288514    1.146057
          customer2 |  -2.525811    .593362    -4.26   0.000    -3.688779   -1.362843
          customer3 |  -.5394759    .511259    -1.06   0.291    -1.541525    .4625733
          customer4 |  -.4191243   .2380119    -1.76   0.078     -.885619    .0473704
          customer5 |  -.8739687    .272772    -3.20   0.001    -1.408592   -.3393454
          customer6 |   .1031133   .3048298     0.34   0.735    -.4943421    .7005687
          customer7 |  -1.872958   .3066893    -6.11   0.000    -2.474058   -1.271858
          customer8 |  -4.452137   .5013338    -8.88   0.000    -5.434734   -3.469541
          customer9 |  -.4244316   .1854046    -2.29   0.022    -.7878179   -.0610453
         customer10 |   1.096344   .2904251     3.77   0.000     .5271216    1.665567
         customer11 |  -1.992748   .3720799    -5.36   0.000    -2.722012   -1.263485
         customer12 |  -2.744971   .7496662    -3.66   0.000     -4.21429   -1.275653
         customer13 |  -2.636557    .377118    -6.99   0.000    -3.375694   -1.897419
         customer14 |   .5378953   .5319014     1.01   0.312    -.5046124    1.580403
         customer15 |    -.72869   .2063074    -3.53   0.000    -1.133045   -.3243349
         customer16 |   -1.83378   .2671302    -6.86   0.000    -2.357345   -1.310214
         customer17 |   .8791208   .2920098     3.01   0.003     .3067921    1.451449
         customer18 |  -.6725495   .2691309    -2.50   0.012    -1.200036   -.1450627
--------------------+----------------------------------------------------------------
           /lnalpha |   1.006674   .1796159     5.60   0.000     .6546335    1.358715
--------------------+----------------------------------------------------------------
              alpha |   2.736485   .4915163                      1.924437     3.89119
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |  -.0044477   .0509791    -0.09   0.930    -.1043649    .0954695
            age |  -.0050142   .0020999    -2.39   0.017      -.00913   -.0008984
         tenure |   .0266184   .0038505     6.91   0.000     .0190715    .0341653
         1.male |  -.0154063   .0151873    -1.01   0.310    -.0451729    .0143603
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est3 stored)

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .7963821     0.96   0.338    -.7972099     2.32455
               creative |  -20.58686    .701111   -29.36   0.000    -21.96101    -19.2127
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5856577    32.72   0.000     18.01421    20.30995
      creativetreatment |  -1.087302   .8825551    -1.23   0.218    -2.817078    .6424743
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. transform
Note: cannot guarantee correctness if there is collinearity in the zinb model!
Warning: many options have been hard-coded; if you're running zinb with nondefault
options, you might want to check that those carry over.
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a Logit model (cmd logit) has been estimated with the
parameters of the inflate process of the zero inflated model.
Note that the point estimates have been inverted, so that a positive sign represents a positive effect.

. eststo: estpost margins, dydx($d)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Pr(inflate), predict()
dy/dx w.r.t. : 1.treatmentper2 1.creativetreatmentper2 age tenure 1.male

-----------------------------------------------------------------------------------------
                        |            Delta-method
                        |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        1.treatmentper2 |   .0656189   .0196098     3.35   0.001     .0271843    .1040534
1.creativetreatmentper2 |  -.0472545   .0372702    -1.27   0.205    -.1203027    .0257937
                    age |  -.0026106   .0012585    -2.07   0.038    -.0050773    -.000144
                 tenure |   .0181301   .0038692     4.69   0.000     .0105465    .0257136
                 1.male |   .0133058   .0091675     1.45   0.147    -.0046621    .0312738
-----------------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est4 stored)

. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8133509     0.94   0.348    -.8304681    2.357809
               creative |  -20.58686   .6965721   -29.55   0.000    -21.95211    -19.2216
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5829434    32.87   0.000     18.01953    20.30463
      creativetreatment |  -1.087302   .8753375    -1.24   0.214    -2.802932     .628328
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. transform2
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a NB2 model (cmd nbreg) has been estimated with the
parameters of the nbreg process of the zero inflated model.

. eststo: estpost margins, dydx($d)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 1.creativetreatmentper2 age tenure 1.male

-----------------------------------------------------------------------------------------
                        |            Delta-method
                        |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        1.treatmentper2 |  -.7737868   .2894459    -2.67   0.008     -1.34109   -.2064832
1.creativetreatmentper2 |   .9879744   .6047836     1.63   0.102    -.1973797    2.173329
                    age |   .0136588   .0099906     1.37   0.172    -.0059224    .0332401
                 tenure |   .0047731   .0289834     0.16   0.869    -.0520333    .0615794
                 1.male |  -.3034626   .1406908    -2.16   0.031    -.5792116   -.0277136
-----------------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est5 stored)

. *Replace treatment effect estimates and SEs with estimates from 1.-4.
. zinb amountideasnoweight $b  customer1-customer18,  inflate($b  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -7.392e+09  
Iteration 1:   log likelihood =  -25601.56  
Iteration 2:   log likelihood = -9452.8836  (backed up)
Iteration 3:   log likelihood = -8794.1343  (backed up)
Iteration 4:   log likelihood = -7698.9614  
Iteration 5:   log likelihood = -6562.2859  
Iteration 6:   log likelihood = -6016.7288  
Iteration 7:   log likelihood = -5869.2897  
Iteration 8:   log likelihood = -5860.9917  
Iteration 9:   log likelihood = -5860.5507  
Iteration 10:  log likelihood = -5860.5432  
Iteration 11:  log likelihood = -5860.5432  

Iteration 0:   log likelihood = -5260.4642  
Iteration 1:   log likelihood =  -5090.915  
Iteration 2:   log likelihood = -5051.4469  
Iteration 3:   log likelihood = -5050.8645  
Iteration 4:   log likelihood = -5050.8642  

Fitting full model:

Iteration 0:   log pseudolikelihood =  -5365.833  
Iteration 1:   log pseudolikelihood = -4774.0665  (not concave)
Iteration 2:   log pseudolikelihood = -4656.3472  (not concave)
Iteration 3:   log pseudolikelihood = -4612.3115  
Iteration 4:   log pseudolikelihood =  -4606.748  
Iteration 5:   log pseudolikelihood = -4562.2091  
Iteration 6:   log pseudolikelihood = -4559.3405  
Iteration 7:   log pseudolikelihood = -4559.0104  
Iteration 8:   log pseudolikelihood = -4558.9452  
Iteration 9:   log pseudolikelihood =  -4558.931  
Iteration 10:  log pseudolikelihood = -4558.9278  
Iteration 11:  log pseudolikelihood =  -4558.927  
Iteration 12:  log pseudolikelihood = -4558.9268  
Iteration 13:  log pseudolikelihood = -4558.9268  

Zero-inflated negative binomial regression      Number of obs     =     17,045
                                                Nonzero obs       =      1,207
                                                Zero obs          =     15,838

Inflation model      = logit                    Wald chi2(34)     =          .
Log pseudolikelihood = -4558.927                Prob > chi2       =          .

                                         (Std. Err. adjusted for 19 clusters in custcode)
-----------------------------------------------------------------------------------------
                        |               Robust
    amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
amountideasnoweight     |
        1.treatmentper2 |     -.8689   .3240146    -2.68   0.007    -1.503957    -.233843
1.creativetreatmentper2 |   .6968072   .2897643     2.40   0.016     .1288796    1.264735
               creative |   1.160009   .1730262     6.70   0.000     .8208835    1.499134
                period2 |   .4090575   .1989469     2.06   0.040     .0191288    .7989862
        creativeperiod2 |  -.9396588   .1897197    -4.95   0.000    -1.311503   -.5678149
      creativetreatment |  -.6606501   .2128622    -3.10   0.002    -1.077852   -.2434479
                    age |  -.0944176   .1003844    -0.94   0.347    -.2911674    .1023321
                        |
            c.age#c.age |   .0017647   .0015776     1.12   0.263    -.0013273    .0048567
                        |
                 tenure |   .0348249   .0478469     0.73   0.467    -.0589533    .1286031
                        |
      c.tenure#c.tenure |   -.004712   .0037457    -1.26   0.208    -.0120534    .0026295
                        |
                 1.male |  -.2838176   .1116612    -2.54   0.011    -.5026696   -.0649656
               salary01 |   1.492799   1.612786     0.93   0.355    -1.668203    4.653802
                salary2 |   1.819099   1.671788     1.09   0.277    -1.457545    5.095743
                salary3 |   1.518726   1.615249     0.94   0.347    -1.647105    4.684557
            salary4plus |   1.987324   1.543414     1.29   0.198    -1.037711     5.01236
            salaryother |  -4.699976   2.293558    -2.05   0.040    -9.195268   -.2046846
              customer1 |   .4585434   .1437573     3.19   0.001     .1767843    .7403024
              customer2 |  -.1932195   .1233476    -1.57   0.117    -.4349763    .0485374
              customer3 |  -.0228393   .1539444    -0.15   0.882    -.3245649    .2788862
              customer4 |  -.0471864   .1049688    -0.45   0.653    -.2529213    .1585486
              customer5 |   .5016061   .1369214     3.66   0.000     .2332451    .7699671
              customer6 |   .3082264   .1074214     2.87   0.004     .0976843    .5187685
              customer7 |  -.7263293   .2366477    -3.07   0.002     -1.19015   -.2625083
              customer8 |  -.3008667   .2440722    -1.23   0.218    -.7792395    .1775061
              customer9 |  -.4021707   .1078778    -3.73   0.000    -.6136074   -.1907341
             customer10 |  -.4571517   .2030461    -2.25   0.024    -.8551147   -.0591886
             customer11 |  -.5841201   .2069358    -2.82   0.005    -.9897068   -.1785334
             customer12 |  -.5151756   .1985527    -2.59   0.009    -.9043317   -.1260196
             customer13 |  -1.211774   .2863727    -4.23   0.000    -1.773054   -.6504934
             customer14 |  -.2593723   .1106632    -2.34   0.019    -.4762682   -.0424763
             customer15 |  -.1893895   .1238505    -1.53   0.126    -.4321321    .0533532
             customer16 |   -1.01203   .2311533    -4.38   0.000    -1.465082    -.558978
             customer17 |   -.480756   .2122587    -2.26   0.024    -.8967754   -.0647366
             customer18 |  -.3537026    .220893    -1.60   0.109    -.7866449    .0792398
------------------------+----------------------------------------------------------------
inflate                 |
        1.treatmentper2 |  -.8027208   .2202086    -3.65   0.000    -1.234322   -.3711198
1.creativetreatmentper2 |   .7636703   .8133509     0.94   0.348    -.8304681    2.357809
               creative |  -20.58686   .6954327   -29.60   0.000    -21.94988   -19.22383
                period2 |  -.1491319   .1048087    -1.42   0.155    -.3545533    .0562894
        creativeperiod2 |   19.16208   .5883595    32.57   0.000     18.00892    20.31524
      creativetreatment |  -1.087302   .8872356    -1.23   0.220    -2.826252    .6516479
                    age |  -.3966798   .1131096    -3.51   0.000    -.6183705   -.1749891
                        |
            c.age#c.age |   .0071136   .0017604     4.04   0.000     .0036632     .010564
                        |
                 tenure |   -.406557   .1136558    -3.58   0.000    -.6293182   -.1837957
                        |
      c.tenure#c.tenure |   .0223396   .0111821     2.00   0.046     .0004232    .0442561
                        |
                 1.male |  -.1787474   .1236783    -1.45   0.148    -.4211524    .0636576
               salary01 |   9.082886   1.819473     4.99   0.000     5.516784    12.64899
                salary2 |   8.681034   1.876681     4.63   0.000     5.002807    12.35926
                salary3 |   8.078851   1.800453     4.49   0.000     4.550029    11.60767
            salary4plus |   7.980737   1.734265     4.60   0.000     4.581639    11.37983
            salaryother |   3.734792   2.117117     1.76   0.078    -.4146816    7.884266
              customer1 |   .3946407   .1290503     3.06   0.002     .1417068    .6475746
              customer2 |  -.2275198   .1430873    -1.59   0.112    -.5079657    .0529262
              customer3 |   1.200024   .1790525     6.70   0.000     .8490879    1.550961
              customer4 |   .6204916   .1177873     5.27   0.000     .3896327    .8513505
              customer5 |  -.1596209   .1307567    -1.22   0.222    -.4158994    .0966576
              customer6 |    1.09179   .1001489    10.90   0.000     .8955023    1.288079
              customer7 |  -.8115345   .1721448    -4.71   0.000    -1.148932   -.4741369
              customer8 |    -2.7064   .4006982    -6.75   0.000    -3.491754   -1.921046
              customer9 |   .3310013   .1142086     2.90   0.004     .1071565    .5548461
             customer10 |    1.59809   .1882387     8.49   0.000     1.229149    1.967031
             customer11 |  -.6376339   .1896182    -3.36   0.001    -1.009279   -.2659891
             customer12 |  -.3585555   .2282467    -1.57   0.116    -.8059107    .0887998
             customer13 |  -1.284701   .2085138    -6.16   0.000    -1.693381   -.8760219
             customer14 |   1.635001   .1393594    11.73   0.000     1.361862     1.90814
             customer15 |  -.3853751   .1345319    -2.86   0.004    -.6490527   -.1216975
             customer16 |  -.6506041    .176269    -3.69   0.000     -.996085   -.3051231
             customer17 |    .893961   .1501972     5.95   0.000       .59958    1.188342
             customer18 |  -.2485147    .168189    -1.48   0.140    -.5781591    .0811297
------------------------+----------------------------------------------------------------
               /lnalpha |   -.877878   .2206158    -3.98   0.000    -1.310277    -.445479
------------------------+----------------------------------------------------------------
                  alpha |    .415664   .0917021                      .2697453    .6405174
-----------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($d)

Average marginal effects                        Number of obs     =     17,045
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 1.creativetreatmentper2 age tenure 1.male

-----------------------------------------------------------------------------------------
                        |            Delta-method
                        |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------------+----------------------------------------------------------------
        1.treatmentper2 |  -.0547168   .0460438    -1.19   0.235    -.1449609    .0355273
1.creativetreatmentper2 |   .0596358   .0831437     0.72   0.473    -.1033229    .2225944
                    age |  -.0004908   .0017352    -0.28   0.777    -.0038916    .0029101
                 tenure |   .0135536   .0037993     3.57   0.000      .006107    .0210001
                 1.male |  -.0301485    .015167    -1.99   0.047    -.0598752   -.0004218
-----------------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est6 stored)

. *Replace treatment effect estimates and SEs with estimates from 1.-4.
. 
. 
. **************************************
. * TABLE 5: IDEA QUALITY
. **************************************
. use idealevel.dta, clear

. global a i.treatmentper2 NumAuthors c.age2##c.age2 c.tenure2##c.tenure2 i.male salary01 salary2 salary3 salary4plus

. global aa i.treatmentper2 NumAuthors  ideasubtype1-ideasubtype5 c.age2##c.age2 c.tenure2##c.tenure2 i.male salary01 salary2 sala
> ry3 salary4plus

. global x i.treatmentper2  NumAuthors ideasubtype1-ideasubtype5 c.age2##c.age2 c.tenure2##c.tenure2 i.male salary01 salary2 salar
> y3

. global b i.treatmentper2 NumAuthors period2  ideasubtype1-ideasubtype5 age2 age2square tenure2 tenure2square i.male salary01 sal
> ary2 salary3 salary4plus

. global bb i.treatmentper2 NumAuthors ideasubtype1-ideasubtype5 age2 age2square tenure2 tenure2square i.male salary01 salary2 sal
> ary3 salary4plus

. global c treatmentper2  NumAuthors c.age2 c.tenure2 male

. 
.         eststo clear

. eststo: reg shared $bb customer1-customer19 month1-month26 [pweight=1/NumAuthors] if finished==1, noconstant vce(cluster custcod
> e)
(sum of wgt is   1.0808e+03)
note: customer19 omitted because of collinearity
note: month26 omitted because of collinearity

Linear regression                               Number of obs     =      1,779
                                                F(18, 18)         =          .
                                                Prob > F          =          .
                                                R-squared         =     0.6869
                                                Root MSE          =      .4222

                                 (Std. Err. adjusted for 19 clusters in custcode)
---------------------------------------------------------------------------------
                |               Robust
         shared |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .2089796   .0872049     2.40   0.028     .0257689    .3921904
     NumAuthors |   .0820272    .019722     4.16   0.001     .0405929    .1234615
   ideasubtype1 |   .6805666   .5465245     1.25   0.229    -.4676387    1.828772
   ideasubtype2 |   .6654474   .5358984     1.24   0.230    -.4604333    1.791328
   ideasubtype3 |    .591234   .5457557     1.08   0.293    -.5553562    1.737824
   ideasubtype4 |    .563925   .5240647     1.08   0.296     -.537094    1.664944
   ideasubtype5 |   .5491968   .5568509     0.99   0.337    -.6207034    1.719097
           age2 |  -.0357368   .0253085    -1.41   0.175    -.0889079    .0174344
     age2square |   .0003605   .0003759     0.96   0.350    -.0004293    .0011503
        tenure2 |   .0437268   .0193198     2.26   0.036     .0031373    .0843162
  tenure2square |  -.0015453   .0015251    -1.01   0.324    -.0047493    .0016587
         1.male |   .0378912   .0554319     0.68   0.503    -.0785669    .1543494
       salary01 |    .074097    .126775     0.58   0.566    -.1922474    .3404414
        salary2 |   .1689812   .1415654     1.19   0.248    -.1284366     .466399
        salary3 |   .1796237   .1960278     0.92   0.372    -.2322155    .5914629
    salary4plus |   .2212361   .2244813     0.99   0.337    -.2503815    .6928538
      customer1 |   .1770005   .0898514     1.97   0.064    -.0117703    .3657712
      customer2 |  -.1138054   .0683473    -1.67   0.113    -.2573976    .0297869
      customer3 |  -.0158818   .0497893    -0.32   0.753    -.1204852    .0887217
      customer4 |   .3722316   .0650009     5.73   0.000     .2356699    .5087933
      customer5 |   -.103381   .0630706    -1.64   0.119    -.2358875    .0291255
      customer6 |  -.0591309   .0674352    -0.88   0.392    -.2008069    .0825451
      customer7 |   .5150002   .1153332     4.47   0.000     .2726941    .7573064
      customer8 |  -.5062837    .064229    -7.88   0.000    -.6412238   -.3713436
      customer9 |  -.0425292    .049593    -0.86   0.402    -.1467202    .0616619
     customer10 |  -.3775963    .031909   -11.83   0.000    -.4446347   -.3105579
     customer11 |  -.1875922   .0456809    -4.11   0.001    -.2835643   -.0916202
     customer12 |  -.2154954   .0535916    -4.02   0.001    -.3280873   -.1029036
     customer13 |   .5858047   .0796233     7.36   0.000     .4185224     .753087
     customer14 |   .1703861   .0587101     2.90   0.010     .0470407    .2937314
     customer15 |  -.1481318   .0689364    -2.15   0.046    -.2929619   -.0033018
     customer16 |  -.3669404   .0405769    -9.04   0.000    -.4521892   -.2816916
     customer17 |   .2255929   .0389144     5.80   0.000     .1438369     .307349
     customer18 |  -.0896376   .0285154    -3.14   0.006    -.1495463    -.029729
     customer19 |          0  (omitted)
         month1 |   .0735681   .1919084     0.38   0.706    -.3296165    .4767526
         month2 |  -.0156692   .1677368    -0.09   0.927    -.3680711    .3367327
         month3 |   .0611287   .1577283     0.39   0.703    -.2702461    .3925034
         month4 |   .0710636   .1819702     0.39   0.701    -.3112415    .4533688
         month5 |   .0516318    .212181     0.24   0.810    -.3941439    .4974075
         month6 |   .1041619   .1703368     0.61   0.549    -.2537024    .4620262
         month7 |    .188276   .2282276     0.82   0.420    -.2912124    .6677644
         month8 |   .3324685   .2060985     1.61   0.124    -.1005283    .7654653
         month9 |  -.0383017   .1823204    -0.21   0.836    -.4213426    .3447392
        month10 |  -.0185209    .146868    -0.13   0.901     -.327079    .2900372
        month11 |   .1096355   .1661255     0.66   0.518    -.2393813    .4586522
        month12 |   .2362506   .1654838     1.43   0.171     -.111418    .5839192
        month13 |   .2582398   .1804089     1.43   0.169    -.1207853     .637265
        month14 |   .1058866    .135301     0.78   0.444    -.1783703    .3901435
        month15 |   .0133653   .2531044     0.05   0.958    -.5183873    .5451179
        month16 |   .0139311   .2254362     0.06   0.951    -.4596929    .4875551
        month17 |   .1010824   .2259665     0.45   0.660    -.3736556    .5758203
        month18 |  -.1541428   .2275556    -0.68   0.507    -.6322194    .3239338
        month19 |  -.0122552   .1866074    -0.07   0.948    -.4043028    .3797924
        month20 |   .0182719   .2044002     0.09   0.930    -.4111569    .4477007
        month21 |   .0358878   .1956166     0.18   0.856    -.3750873     .446863
        month22 |    .055592   .2050763     0.27   0.789    -.3752574    .4864414
        month23 |   .2552763   .2055874     1.24   0.230    -.1766468    .6871994
        month24 |   .0850299   .1930456     0.44   0.665    -.3205438    .4906037
        month25 |   .0911834   .1807165     0.50   0.620     -.288488    .4708548
        month26 |          0  (omitted)
---------------------------------------------------------------------------------
(est1 stored)

. logit shared $aa customer1-customer19 month1-month26 [pweight=1/NumAuthors] if finished==1, noconstant vce(cluster custcode)

note: customer7 != 0 predicts success perfectly
      customer7 dropped and 20 obs not used

note: customer8 != 0 predicts failure perfectly
      customer8 dropped and 12 obs not used

note: customer10 != 0 predicts failure perfectly
      customer10 dropped and 12 obs not used

note: customer16 != 0 predicts failure perfectly
      customer16 dropped and 38 obs not used

note: customer19 omitted because of collinearity
note: month26 omitted because of collinearity
Iteration 0:   log pseudolikelihood =  -706.8946  
Iteration 1:   log pseudolikelihood = -547.76022  
Iteration 2:   log pseudolikelihood = -546.47847  
Iteration 3:   log pseudolikelihood = -546.45914  
Iteration 4:   log pseudolikelihood = -546.45495  
Iteration 5:   log pseudolikelihood = -546.45406  
Iteration 6:   log pseudolikelihood = -546.45389  
Iteration 7:   log pseudolikelihood = -546.45387  

Logistic regression                             Number of obs     =      1,697
                                                Wald chi2(19)     =          .
Log pseudolikelihood = -546.45387               Prob > chi2       =          .

                                     (Std. Err. adjusted for 15 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
             shared |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
    1.treatmentper2 |   1.067504   .4647208     2.30   0.022     .1566678     1.97834
         NumAuthors |   .5096163   .1498236     3.40   0.001     .2159675    .8032651
       ideasubtype1 |   -8.85715   3.138896    -2.82   0.005    -15.00927   -2.705027
       ideasubtype2 |  -8.971373   3.108632    -2.89   0.004    -15.06418   -2.878565
       ideasubtype3 |  -9.377669   3.193205    -2.94   0.003    -15.63623   -3.119103
       ideasubtype4 |  -9.500932   3.024933    -3.14   0.002    -15.42969   -3.572171
       ideasubtype5 |  -9.637868   3.242691    -2.97   0.003    -15.99343   -3.282311
               age2 |  -.1865495    .181698    -1.03   0.305    -.5426711    .1695721
                    |
      c.age2#c.age2 |   .0015986   .0029375     0.54   0.586    -.0041589    .0073561
                    |
            tenure2 |   .2538896   .0970815     2.62   0.009     .0636134    .4441658
                    |
c.tenure2#c.tenure2 |  -.0092742   .0098683    -0.94   0.347    -.0286157    .0100673
                    |
             1.male |   .2057913   .2940485     0.70   0.484    -.3705331    .7821157
           salary01 |   10.32464   .7280639    14.18   0.000     8.897658    11.75162
            salary2 |   10.87681   .6901938    15.76   0.000     9.524052    12.22956
            salary3 |   11.02591   .6544404    16.85   0.000     9.743232    12.30859
        salary4plus |   11.25016   .7172484    15.69   0.000     9.844381    12.65594
          customer1 |   .7237407   .4886715     1.48   0.139    -.2340379    1.681519
          customer2 |  -.7050419   .4080121    -1.73   0.084    -1.504731    .0946472
          customer3 |  -.1173783   .2399592    -0.49   0.625    -.5876898    .3529332
          customer4 |   1.890043   .3630767     5.21   0.000     1.178426     2.60166
          customer5 |  -.6527967   .3086353    -2.12   0.034    -1.257711   -.0478826
          customer6 |  -.3266036   .4067697    -0.80   0.422    -1.123858    .4706504
          customer7 |          0  (omitted)
          customer8 |          0  (omitted)
          customer9 |    -.40305   .2582512    -1.56   0.119     -.909213    .1031129
         customer10 |          0  (omitted)
         customer11 |  -1.214151   .2542178    -4.78   0.000    -1.712409   -.7158934
         customer12 |  -1.350932   .2897543    -4.66   0.000     -1.91884   -.7830239
         customer13 |   3.432268   .5922774     5.80   0.000     2.271426     4.59311
         customer14 |   .6425311   .2283985     2.81   0.005     .1948783    1.090184
         customer15 |  -.8904327    .348465    -2.56   0.011    -1.573411   -.2074539
         customer16 |          0  (omitted)
         customer17 |   .9566537   .2559076     3.74   0.000      .455084    1.458223
         customer18 |  -.5422249   .2653012    -2.04   0.041    -1.062206    -.022244
         customer19 |          0  (omitted)
             month1 |   .3368435   1.162748     0.29   0.772    -1.942101    2.615788
             month2 |  -.1547936   1.060866    -0.15   0.884    -2.234052    1.924465
             month3 |   .3437929   1.004833     0.34   0.732    -1.625644     2.31323
             month4 |   .4214242   1.140903     0.37   0.712    -1.814705    2.657553
             month5 |   .2504176   1.251625     0.20   0.841    -2.202723    2.703558
             month6 |   .6923391    1.13056     0.61   0.540    -1.523517    2.908196
             month7 |   1.039409   1.498203     0.69   0.488    -1.897015    3.975832
             month8 |   1.907771   1.373531     1.39   0.165     -.784301    4.599843
             month9 |  -.2948538     1.1274    -0.26   0.794    -2.504518     1.91481
            month10 |  -.2734708   .9294977    -0.29   0.769    -2.095253    1.548311
            month11 |   .5800574   1.127576     0.51   0.607    -1.629951    2.790066
            month12 |   1.410755   1.132034     1.25   0.213    -.8079916    3.629502
            month13 |    1.56276   1.182717     1.32   0.186    -.7553232    3.880842
            month14 |   .6417716   .9108864     0.70   0.481    -1.143533    2.427076
            month15 |   .1095303   1.469854     0.07   0.941    -2.771331    2.990392
            month16 |   .1621639   1.374593     0.12   0.906    -2.531988    2.856316
            month17 |   .5526833   1.396747     0.40   0.692     -2.18489    3.290256
            month18 |  -.6713466   1.272824    -0.53   0.598    -3.166035    1.823342
            month19 |   .0214062   1.168927     0.02   0.985    -2.269649    2.312461
            month20 |    .173585   1.210552     0.14   0.886    -2.199053    2.546223
            month21 |    .322698   1.229382     0.26   0.793    -2.086846    2.732242
            month22 |   .3696612   1.276159     0.29   0.772    -2.131564    2.870887
            month23 |   1.683298   1.437509     1.17   0.242    -1.134169    4.500764
            month24 |   .5584542   1.208454     0.46   0.644    -1.810073    2.926981
            month25 |   .5594146   1.110487     0.50   0.614    -1.617099    2.735928
            month26 |          0  (omitted)
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =      1,697
Model VCE    : Robust

Expression   : Pr(shared), predict()
dy/dx w.r.t. : 1.treatmentper2 NumAuthors age2 tenure2 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1878224   .0794481     2.36   0.018      .032107    .3435378
     NumAuthors |   .0917127   .0252187     3.64   0.000     .0422849    .1411405
           age2 |  -.0162376   .0046679    -3.48   0.001    -.0253864   -.0070887
        tenure2 |    .031746   .0118283     2.68   0.007      .008563     .054929
         1.male |   .0373103     .05343     0.70   0.485    -.0674106    .1420312
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est2 stored)

. eststo: reg implemented $bb customer1-customer19 month1-month26 [pweight=1/NumAuthors] if finished==1, noconstant vce(cluster cu
> stcode)
(sum of wgt is   1.0808e+03)
note: customer19 omitted because of collinearity
note: month26 omitted because of collinearity

Linear regression                               Number of obs     =      1,779
                                                F(18, 18)         =          .
                                                Prob > F          =          .
                                                R-squared         =     0.7528
                                                Root MSE          =     .37622

                                 (Std. Err. adjusted for 19 clusters in custcode)
---------------------------------------------------------------------------------
                |               Robust
    implemented |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1528441   .0837386     1.83   0.085    -.0230842    .3287724
     NumAuthors |   .0595115   .0227727     2.61   0.018     .0116679    .1073551
   ideasubtype1 |  -.0120024   .4771235    -0.03   0.980    -1.014402    .9903969
   ideasubtype2 |  -.0459331   .4818994    -0.10   0.925    -1.058366       .9665
   ideasubtype3 |  -.0760439   .4767125    -0.16   0.875     -1.07758    .9254919
   ideasubtype4 |  -.1079617   .4824865    -0.22   0.825    -1.121628    .9057049
   ideasubtype5 |  -.0749666    .500352    -0.15   0.883    -1.126167     .976234
           age2 |  -.0365426   .0246914    -1.48   0.156    -.0884172    .0153321
     age2square |   .0004184   .0003047     1.37   0.187    -.0002217    .0010584
        tenure2 |   .0140187   .0222118     0.63   0.536    -.0326466     .060684
  tenure2square |  -.0008547   .0017912    -0.48   0.639    -.0046179    .0029085
         1.male |   .1139746   .0395758     2.88   0.010      .030829    .1971203
       salary01 |   .4958057   .1109899     4.47   0.000     .2626246    .7289869
        salary2 |   .5956094   .1170076     5.09   0.000     .3497856    .8414333
        salary3 |   .6619349   .1186248     5.58   0.000     .4127134    .9111565
    salary4plus |   .7603438     .13798     5.51   0.000     .4704586    1.050229
      customer1 |  -.0560707   .0648218    -0.86   0.398    -.1922561    .0801148
      customer2 |   .0871888   .0692203     1.26   0.224    -.0582377    .2326152
      customer3 |  -.0786181   .0658909    -1.19   0.248    -.2170498    .0598135
      customer4 |    .496784   .0515783     9.63   0.000      .388422     .605146
      customer5 |   .0024548   .0550952     0.04   0.965     -.113296    .1182055
      customer6 |   .2236829   .0474018     4.72   0.000     .1240953    .3232705
      customer7 |   .6750622   .0742968     9.09   0.000     .5189704    .8311539
      customer8 |   .0083394   .1001915     0.08   0.935    -.2021551    .2188338
      customer9 |    .147165   .0493174     2.98   0.008      .043553     .250777
     customer10 |  -.2544315   .0427347    -5.95   0.000    -.3442139   -.1646491
     customer11 |   .6702213   .0769703     8.71   0.000     .5085126    .8319299
     customer12 |   .5278864   .0779841     6.77   0.000     .3640479     .691725
     customer13 |   .7321728   .0528906    13.84   0.000     .6210537     .843292
     customer14 |   .4003504   .0915332     4.37   0.000     .2080462    .5926546
     customer15 |  -.0696205   .0614744    -1.13   0.272    -.1987734    .0595324
     customer16 |   .5964908   .0529343    11.27   0.000     .4852799    .7077017
     customer17 |   .6426752   .0752583     8.54   0.000     .4845633    .8007871
     customer18 |  -.0185649    .042975    -0.43   0.671     -.108852    .0717222
     customer19 |          0  (omitted)
         month1 |   .1461815   .1769878     0.83   0.420    -.2256561    .5180191
         month2 |   .2237547   .0948855     2.36   0.030     .0244077    .4231018
         month3 |   .1676285    .152479     1.10   0.286     -.152718    .4879749
         month4 |   .2153441   .1013668     2.12   0.048     .0023804    .4283078
         month5 |   .1881784   .1023983     1.84   0.083    -.0269524    .4033093
         month6 |   .1091967   .1160149     0.94   0.359    -.1345414    .3529349
         month7 |   .2843698   .1393396     2.04   0.056    -.0083717    .5771114
         month8 |   .3398876   .1501417     2.26   0.036     .0244517    .6553235
         month9 |   .1049675   .0945799     1.11   0.282    -.0937376    .3036725
        month10 |   .2727169   .1143517     2.38   0.028      .032473    .5129608
        month11 |   .2856467   .0938495     3.04   0.007     .0884761    .4828173
        month12 |   .3231463    .088731     3.64   0.002     .1367293    .5095633
        month13 |   .4028655    .110531     3.64   0.002     .1706485    .6350825
        month14 |   .2737585   .0846439     3.23   0.005     .0959282    .4515888
        month15 |   .1162779   .1298973     0.90   0.383    -.1566262     .389182
        month16 |    .200359   .1331245     1.51   0.150    -.0793252    .4800432
        month17 |   .2610414   .1106201     2.36   0.030     .0286371    .4934457
        month18 |   .0339278   .1515771     0.22   0.825    -.2845239    .3523795
        month19 |   .2457429    .084773     2.90   0.010     .0676414    .4238444
        month20 |   .3359709   .1063174     3.16   0.005     .1126063    .5593355
        month21 |   .1317985   .1018645     1.29   0.212    -.0822108    .3458078
        month22 |   .0808813   .1326721     0.61   0.550    -.1978524    .3596151
        month23 |   .4663671   .0721062     6.47   0.000     .3148775    .6178566
        month24 |   .2177769   .1922942     1.13   0.272    -.1862182     .621772
        month25 |    .224338   .1428737     1.57   0.134    -.0758285    .5245045
        month26 |          0  (omitted)
---------------------------------------------------------------------------------
(est3 stored)

. logit implemented $x customer1-customer18 month1-month25 [pweight=1/NumAuthors] if finished==1, noconstant vce(cluster custcode)

note: customer7 != 0 predicts success perfectly
      customer7 dropped and 20 obs not used

note: customer10 != 0 predicts failure perfectly
      customer10 dropped and 12 obs not used

Iteration 0:   log pseudolikelihood = -733.46524  
Iteration 1:   log pseudolikelihood = -461.79712  
Iteration 2:   log pseudolikelihood = -457.13207  
Iteration 3:   log pseudolikelihood = -457.07005  
Iteration 4:   log pseudolikelihood = -457.07004  

Logistic regression                             Number of obs     =      1,747
                                                Wald chi2(16)     =          .
Log pseudolikelihood = -457.07004               Prob > chi2       =          .

                                     (Std. Err. adjusted for 17 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
        implemented |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
    1.treatmentper2 |   1.409576   .7786097     1.81   0.070    -.1164708    2.935623
         NumAuthors |   .4673929   .1309452     3.57   0.000     .2107449    .7240408
       ideasubtype1 |   2.942913   2.931626     1.00   0.315    -2.802968    8.688795
       ideasubtype2 |   2.659407   3.041256     0.87   0.382    -3.301346    8.620159
       ideasubtype3 |    2.46956   2.978394     0.83   0.407    -3.367985    8.307105
       ideasubtype4 |   2.195075   3.109514     0.71   0.480    -3.899461    8.289611
       ideasubtype5 |   2.412915   3.171294     0.76   0.447    -3.802707    8.628538
               age2 |  -.3139669   .1657513    -1.89   0.058    -.6388334    .0108996
                    |
      c.age2#c.age2 |   .0038189   .0023356     1.64   0.102    -.0007589    .0083966
                    |
            tenure2 |   .1244081    .138425     0.90   0.369    -.1468999    .3957161
                    |
c.tenure2#c.tenure2 |  -.0084901   .0111584    -0.76   0.447    -.0303602      .01338
                    |
             1.male |    .798474    .252026     3.17   0.002     .3045121    1.292436
           salary01 |   -1.94834   .8938335    -2.18   0.029    -3.700222   -.1964587
            salary2 |  -1.246954   .7373047    -1.69   0.091    -2.692045    .1981362
            salary3 |   -.753505   .6537709    -1.15   0.249    -2.034872    .5278624
          customer1 |  -.4005124    .450907    -0.89   0.374    -1.284274    .4832492
          customer2 |   .3654168    .459498     0.80   0.426    -.5351827    1.266016
          customer3 |  -.5521889   .4561979    -1.21   0.226     -1.44632    .3419426
          customer4 |   2.450593   .3669373     6.68   0.000      1.73141    3.169777
          customer5 |  -.0182035   .3982906    -0.05   0.964    -.7988387    .7624317
          customer6 |   1.266722   .4759759     2.66   0.008     .3338265    2.199618
          customer7 |          0  (omitted)
          customer8 |  -.0471624   .6332971    -0.07   0.941    -1.288402    1.194077
          customer9 |   .6358626   .4363664     1.46   0.145    -.2193998    1.491125
         customer10 |          0  (omitted)
         customer11 |   3.683317   .7472816     4.93   0.000     2.218672    5.147962
         customer12 |   2.795456   .5747075     4.86   0.000      1.66905    3.921862
         customer13 |   4.403759   .4377122    10.06   0.000     3.545859    5.261659
         customer14 |   1.744346   .3592506     4.86   0.000     1.040228    2.448464
         customer15 |   -.572388   .3684853    -1.55   0.120    -1.294606      .14983
         customer16 |   3.367162   .4248637     7.93   0.000     2.534444    4.199879
         customer17 |   3.894119   .7252333     5.37   0.000     2.472688     5.31555
         customer18 |  -.0365047   .4110818    -0.09   0.929    -.8422103    .7692008
             month1 |   1.279785   1.169099     1.09   0.274    -1.011607    3.571176
             month2 |   1.855036    .760533     2.44   0.015     .3644186    3.345653
             month3 |   1.469541   1.172609     1.25   0.210    -.8287311    3.767813
             month4 |   1.830409   .8413541     2.18   0.030     .1813852    3.479433
             month5 |   1.541006   .8352713     1.84   0.065    -.0960958    3.178108
             month6 |   1.221418   .8897141     1.37   0.170    -.5223898    2.965225
             month7 |   2.326368   1.125714     2.07   0.039     .1200093    4.532726
             month8 |    2.56712   1.083996     2.37   0.018     .4425261    4.691713
             month9 |   .7419289   .7530018     0.99   0.324    -.7339276    2.217785
            month10 |   2.134809   .9002401     2.37   0.018     .3703713    3.899248
            month11 |   2.191484   .8566776     2.56   0.011     .5124266    3.870541
            month12 |   2.612475   .7213848     3.62   0.000     1.198586    4.026363
            month13 |   3.139112   .8259598     3.80   0.000      1.52026    4.757963
            month14 |   1.831821   .6967658     2.63   0.009     .4661854    3.197457
            month15 |   .5987972   .8582514     0.70   0.485    -1.083345    2.280939
            month16 |   1.196753   .8730839     1.37   0.170    -.5144597    2.907966
            month17 |    1.71856   .7769259     2.21   0.027      .195813    3.241307
            month18 |   .0533432   1.056161     0.05   0.960    -2.016694    2.123381
            month19 |    1.61913    .583858     2.77   0.006     .4747896    2.763471
            month20 |   2.298673   .6572288     3.50   0.000     1.010528    3.586817
            month21 |   .9475014   .6570168     1.44   0.149    -.3402278    2.235231
            month22 |   .5939066   .8598535     0.69   0.490    -1.091375    2.279189
            month23 |   2.676568   .5802576     4.61   0.000     1.539284    3.813852
            month24 |   1.423217    1.43809     0.99   0.322    -1.395388    4.241822
            month25 |   1.499096   .8403253     1.78   0.074    -.1479113    3.146103
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =      1,747
Model VCE    : Robust

Expression   : Pr(implemented), predict()
dy/dx w.r.t. : 1.treatmentper2 NumAuthors age2 tenure2 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1774899   .0868938     2.04   0.041     .0071812    .3477985
     NumAuthors |    .064239   .0177279     3.62   0.000      .029493     .098985
           age2 |  -.0118613   .0063858    -1.86   0.063    -.0243772    .0006547
        tenure2 |   .0076033   .0105246     0.72   0.470    -.0130246    .0282312
         1.male |   .1109723   .0337493     3.29   0.001     .0448249    .1771198
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est4 stored)

. eststo: reg lognetgain $bb customer1-customer19 month1-month26 [pweight=1/NumAuthors], noconstant  vce(cluster custcode)
(sum of wgt is   1.2136e+03)
note: salary4plus omitted because of collinearity
note: customer19 omitted because of collinearity
note: month26 omitted because of collinearity

Linear regression                               Number of obs     =      1,912
                                                F(18, 18)         =          .
                                                Prob > F          =          .
                                                R-squared         =     0.9623
                                                Root MSE          =      1.841

                                 (Std. Err. adjusted for 19 clusters in custcode)
---------------------------------------------------------------------------------
                |               Robust
     lognetgain |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |    .308342   .3904378     0.79   0.440    -.5119374    1.128621
     NumAuthors |   .1851547   .0694538     2.67   0.016     .0392377    .3310717
   ideasubtype1 |   3.729846    2.92647     1.27   0.219    -2.418438    9.878131
   ideasubtype2 |   3.021501   2.865778     1.05   0.306    -2.999276    9.042278
   ideasubtype3 |   2.918683   2.866236     1.02   0.322    -3.103056    8.940422
   ideasubtype4 |   3.137721   3.030474     1.04   0.314    -3.229069    9.504511
   ideasubtype5 |   2.694156   2.832842     0.95   0.354    -3.257425    8.645737
           age2 |   .3411717   .1818902     1.88   0.077    -.0409655    .7233089
     age2square |  -.0052107   .0026297    -1.98   0.063    -.0107356    .0003142
        tenure2 |   .1288097    .061364     2.10   0.050    -.0001114    .2577307
  tenure2square |  -.0051237   .0059052    -0.87   0.397    -.0175301    .0072827
         1.male |  -.0599922   .2725364    -0.22   0.828    -.6325699    .5125856
       salary01 |  -.8920299   .3976309    -2.24   0.038    -1.727422   -.0566383
        salary2 |   -.933587   .3188556    -2.93   0.009    -1.603478   -.2636962
        salary3 |  -.5816538   .3339039    -1.74   0.099     -1.28316    .1198523
    salary4plus |          0  (omitted)
      customer1 |   1.430622   .1704201     8.39   0.000     1.072583    1.788661
      customer2 |   1.523917   .1741906     8.75   0.000     1.157956    1.889877
      customer3 |  -.1925977   .1802638    -1.07   0.299    -.5713179    .1861225
      customer4 |   .3644106   .2388125     1.53   0.144    -.1373159    .8661371
      customer5 |   1.092149   .2034662     5.37   0.000     .6646825    1.519616
      customer6 |   -.658355   .2862856    -2.30   0.034    -1.259819   -.0568914
      customer7 |   .2846464   .3378654     0.84   0.411    -.4251825    .9944752
      customer8 |   -.558791   .3293892    -1.70   0.107    -1.250812      .13323
      customer9 |   .6650515   .1738872     3.82   0.001      .299728    1.030375
     customer10 |   1.046208   .1926842     5.43   0.000     .6413936    1.451023
     customer11 |    1.44481   .4242384     3.41   0.003     .5535186    2.336102
     customer12 |  -.4285128   .3863343    -1.11   0.282    -1.240171    .3831455
     customer13 |   1.370959   .5887232     2.33   0.032     .1340973    2.607821
     customer14 |    2.76763   .2138965    12.94   0.000      2.31825     3.21701
     customer15 |   .7053273   .1656936     4.26   0.000     .3572179    1.053437
     customer16 |  -.5290028   .2865379    -1.85   0.081    -1.130997     .072991
     customer17 |   1.041929   .3600044     2.89   0.010     .2855874     1.79827
     customer18 |   3.310408   .3256966    10.16   0.000     2.626145    3.994671
     customer19 |          0  (omitted)
         month1 |  -.6392249   .5892649    -1.08   0.292    -1.877225    .5987747
         month2 |   -.380392   .5070055    -0.75   0.463    -1.445571     .684787
         month3 |   .1467992   .5174788     0.28   0.780    -.9403833    1.233982
         month4 |  -.5577723   .5911567    -0.94   0.358    -1.799746    .6842018
         month5 |  -.5015719    .374144    -1.34   0.197    -1.287619    .2844755
         month6 |  -.7691985   .4413953    -1.74   0.098    -1.696536    .1581386
         month7 |  -.7495525   .4821524    -1.55   0.137    -1.762517    .2634122
         month8 |  -.8396956    .829754    -1.01   0.325    -2.582944    .9035528
         month9 |   -.656155   .5226408    -1.26   0.225    -1.754183    .4418726
        month10 |  -1.257167   .5458533    -2.30   0.033    -2.403962   -.1103717
        month11 |  -.6325238   .7820375    -0.81   0.429    -2.275524    1.010476
        month12 |  -.4172551   .4879492    -0.86   0.404    -1.442398     .607888
        month13 |  -.3273278   .5314066    -0.62   0.546    -1.443772    .7891161
        month14 |  -.7876394    .500174    -1.57   0.133    -1.838466    .2631872
        month15 |  -.0872989   .5075016    -0.17   0.865     -1.15352    .9789223
        month16 |   .1153331   .3214217     0.36   0.724    -.5599489    .7906152
        month17 |  -.5500513   .3946009    -1.39   0.180    -1.379077    .2789745
        month18 |  -.8228263   .2594177    -3.17   0.005    -1.367843     -.27781
        month19 |   .2292189   .2484238     0.92   0.368    -.2927001    .7511379
        month20 |   .0561338   .3948856     0.14   0.889      -.77349    .8857577
        month21 |    .091507   .1640971     0.56   0.584    -.2532481    .4362621
        month22 |   .2873021   .2741136     1.05   0.308    -.2885893    .8631935
        month23 |   .1522097    .369903     0.41   0.686    -.6249276    .9293471
        month24 |   .5530136   .3008094     1.84   0.083    -.0789636    1.184991
        month25 |  -.5574153   .5342188    -1.04   0.311    -1.679767    .5649367
        month26 |          0  (omitted)
---------------------------------------------------------------------------------
(est5 stored)

. 
. 
.         #delimit ;
delimiter now ;
.         esttab using "$dir\tabs\5_Ideaquality.tex", 
>         cells(b(star fmt(%9.3f)) se(par fmt(%9.3f) )) starlevels(* .10 ** 0.05 *** .01) 
>         stats(r2 ll N_clust N, fmt(%9.3f %9.2f %9.0f %9.0f) labels(R$^2$ Log Pseudo likelihood Clusters Observations))
>         keep( 1.treatmentper2 NumAuthors  age2 tenure2 age2square tenure2square 1.male)
>         order( 1.treatmentper2 NumAuthors  age2 age2square tenure2 tenure2square 1.male)
>         varlabels(1.treatmentper2 "DID Treatment" NumAuthors "Number of Authors" age2 Age tenure2 Tenure age2square "Age$^2$" te
> nure2square "Tenure$^2$" 1.male Male, 
>         elist(1.treatmentper2 "[2mm]" NumAuthors "[2mm]" age2 "[2mm]" age2square "[2mm]" tenure2 "[2mm]" tenure2square "[2mm]" 1
> .male 
>           "\midrule Controls salary groups  &yes& yes& yes& yes & yes\\ 
>          Controls project type  &yes& yes& yes& yes & yes \\ Client FE  &yes& yes& yes& yes& yes\\
>          Time FE & month & month & month & month & month  \\"
>         ))      nonumbers collabels(,none) mlabels("(1) OLS"  "(2) Logit AME" "(3) OLS" "(4) Logit AME" "(5) OLS") 
>         prehead("\begin{table}[h]%"  "\small"  "\caption{\label{tab:quality}Treatment effects on various idea quality measures}%
> " 
>         "\begin{center}%" "\begin{tabular}{lccccc}" 
>         "\toprule") posthead("[3mm] Dependent variable & Shared & Shared &Implemented & Implemented & Log(Net Value) \\" "\midru
> le")  prefoot("") 
>         postfoot("\bottomrule" "\end{tabular}" "\\ [2mm] \begin{minipage}{\textwidth}" 
>         "\footnotesize" "{\it Note:} 
>         
> The table reports estimates of OLS and logistic regressions using as outcome variables  the probability that an idea is shared  
>  
> with the customer (columns 1 and 2), the probability that an idea is accepted for implementation (columns 3 and 4), and the 
> logarithm of the projected net value (profit from the idea) (column 5). The treatment effect is the difference-in-differences 
> estimator. The unit of observation is the author-idea. Each observation is weighted by 1/(\textit{Number of Authors}), where 
> \textit{Number of Authors} represents the number of employees who submit the idea together. Only ideas with finished review 
> process (either accepted or rejected) are included in the samples for columns (1) to (4). Marginal effects of \textit{Age} and 
> \textit{Tenure} are based on linear and quadratic terms.          Standard errors are clustered at the client team level.       
>    
>  ***Significant at the 1\% level; **significant at the 5\% level; *significant at the 10\% level. 
>         
>         " "\end{minipage}" 
>         "\end{center}" "\end{table}") style(tex) replace
> ;
(output written to C:\Dropbox\GNS Creativity\india\tabs\5_Ideaquality.tex)

. #delimit cr
delimiter now cr
. 
. 
. *************************************
. * TABLE 6: POST TREATMENT EFFECTS
. ************************************
. *ONE TABLE FOR POST EFFECTS FOR BOTH QUALITY AND QUANTITY
. use person-inactive-expost.dta, clear

. global a i.treatmentper2 i.treatmentper3 period2 period3 c.age##c.age c.tenure##c.tenure i.male salary01 salary2 salary3 salary4
> plus salaryother

. global c treatmentper2 treatmentper3 age tenure male

. 
.         eststo clear

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -479231.17  
Iteration 1:   log likelihood =  -17067.75  
Iteration 2:   log likelihood =  -15955.96  
Iteration 3:   log likelihood = -10828.957  
Iteration 4:   log likelihood = -10690.511  
Iteration 5:   log likelihood = -10680.636  
Iteration 6:   log likelihood = -10680.576  
Iteration 7:   log likelihood = -10680.575  

Iteration 0:   log likelihood = -9059.7229  (not concave)
Iteration 1:   log likelihood =  -8019.656  
Iteration 2:   log likelihood = -7987.4375  
Iteration 3:   log likelihood = -7987.3072  
Iteration 4:   log likelihood = -7987.3072  

Fitting full model:

Iteration 0:   log pseudolikelihood = -8357.6268  
Iteration 1:   log pseudolikelihood =  -7875.893  (not concave)
Iteration 2:   log pseudolikelihood = -7822.8714  
Iteration 3:   log pseudolikelihood = -7779.7312  
Iteration 4:   log pseudolikelihood = -7768.4457  
Iteration 5:   log pseudolikelihood = -7767.8577  
Iteration 6:   log pseudolikelihood = -7767.8336  
Iteration 7:   log pseudolikelihood = -7767.8333  

Zero-inflated negative binomial regression      Number of obs     =     25,152
                                                Nonzero obs       =      1,733
                                                Zero obs          =     23,419

Inflation model      = logit                    Wald chi2(32)     =          .
Log pseudolikelihood = -7767.833                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.5795847   .2998704    -1.93   0.053     -1.16732    .0081506
    1.treatmentper3 |  -.4522651    .433069    -1.04   0.296    -1.301065    .3965345
            period2 |  -.3059684   .2799127    -1.09   0.274    -.8545872    .2426504
            period3 |  -.0932869   .3481347    -0.27   0.789    -.7756185    .5890446
                age |   .1026131   .1366387     0.75   0.453    -.1651938    .3704201
                    |
        c.age#c.age |  -.0014542   .0020507    -0.71   0.478    -.0054735     .002565
                    |
             tenure |   .0805191   .0812164     0.99   0.321    -.0786621    .2397003
                    |
  c.tenure#c.tenure |  -.0081168    .007393    -1.10   0.272    -.0226068    .0063733
                    |
             1.male |   -.209422   .1381568    -1.52   0.130    -.4802044    .0613603
           salary01 |  -2.307494   2.062705    -1.12   0.263    -6.350321    1.735334
            salary2 |  -2.067861   2.162446    -0.96   0.339    -6.306177    2.170455
            salary3 |   -2.24186   2.153182    -1.04   0.298    -6.462018    1.978299
        salary4plus |  -1.293739   2.228159    -0.58   0.561     -5.66085    3.073371
        salaryother |  -8.085406   2.636898    -3.07   0.002    -13.25363   -2.917182
          customer1 |   .7053194   .2918392     2.42   0.016     .1333251    1.277314
          customer2 |  -.2806297   .2905428    -0.97   0.334    -.8500832    .2888237
          customer3 |  -.2960134   .3202046    -0.92   0.355    -.9236029     .331576
          customer4 |  -.1130191   .3071687    -0.37   0.713    -.7150587    .4890206
          customer5 |   1.064836   .3470928     3.07   0.002     .3845462    1.745125
          customer6 |  -.4041439   .3314369    -1.22   0.223    -1.053748    .2454605
          customer7 |  -.4804177   .2701017    -1.78   0.075    -1.009807    .0489719
          customer8 |   1.058475   .2456219     4.31   0.000     .5770649    1.539885
          customer9 |  -.8427544   .2323271    -3.63   0.000    -1.298107   -.3874017
         customer10 |  -.4786689   .3001979    -1.59   0.111    -1.067046    .1097081
         customer11 |  -.0871993   .3002294    -0.29   0.771    -.6756381    .5012395
         customer12 |   .0763843   .2965569     0.26   0.797    -.5048565    .6576251
         customer13 |  -.4678895   .2829004    -1.65   0.098    -1.022364    .0865852
         customer14 |  -.2602431   .4031629    -0.65   0.519    -1.050428    .5299417
         customer15 |   .1476011   .2693503     0.55   0.584    -.3803158    .6755181
         customer16 |  -.2427898   .2983226    -0.81   0.416    -.8274912    .3419117
         customer17 |  -.1734308   .2357795    -0.74   0.462    -.6355502    .2886885
         customer18 |   .2091287   .2040181     1.03   0.305    -.1907394    .6089968
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322528   .4391231    -3.01   0.003    -2.183194   -.4618629
    1.treatmentper3 |   -1.79401   .7857814    -2.28   0.022    -3.334113   -.2539066
            period2 |    .526884   .2176647     2.42   0.015      .100269    .9534989
            period3 |   1.275496   .6025057     2.12   0.034     .0946061    2.456385
                age |  -.1343899   .1210624    -1.11   0.267    -.3716679    .1028881
                    |
        c.age#c.age |   .0032638   .0017988     1.81   0.070    -.0002617    .0067893
                    |
             tenure |  -.7765933   .1051202    -7.39   0.000    -.9826251   -.5705616
                    |
  c.tenure#c.tenure |   .0363361   .0154617     2.35   0.019     .0060318    .0666405
                    |
             1.male |  -.4051985   .1564811    -2.59   0.010    -.7118959   -.0985011
           salary01 |   4.492795   2.033454     2.21   0.027     .5072977    8.478293
            salary2 |   3.667313   2.171374     1.69   0.091    -.5885009    7.923127
            salary3 |   2.721254   2.073857     1.31   0.189    -1.343432     6.78594
        salary4plus |   3.954319   1.699154     2.33   0.020     .6240393    7.284599
        salaryother |  -5.051751   9.281634    -0.54   0.586    -23.24342    13.13992
          customer1 |    .481111   .4712356     1.02   0.307    -.4424939    1.404716
          customer2 |  -2.516859   .6146042    -4.10   0.000    -3.721461   -1.312257
          customer3 |   .9248282   .4737462     1.95   0.051    -.0036972    1.853354
          customer4 |  -.4862248   .4281626    -1.14   0.256    -1.325408    .3529584
          customer5 |  -.7563505   .5033259    -1.50   0.133    -1.742851      .23015
          customer6 |  -.6620719   .4561584    -1.45   0.147    -1.556126    .2319821
          customer7 |  -2.557616   .5098507    -5.02   0.000    -3.556905   -1.558327
          customer8 |  -4.539873   1.506243    -3.01   0.003    -7.492054   -1.587691
          customer9 |  -.5644092   .3227825    -1.75   0.080    -1.197051    .0682329
         customer10 |   .1721992   .5272149     0.33   0.744     -.861123    1.205521
         customer11 |  -3.498968   .9878253    -3.54   0.000     -5.43507   -1.562865
         customer12 |  -2.561616   .8117154    -3.16   0.002    -4.152549   -.9706826
         customer13 |  -2.367817   .6263556    -3.78   0.000    -3.595451   -1.140182
         customer14 |   .4756682   .6059805     0.78   0.432    -.7120317    1.663368
         customer15 |  -.7354965   .3678323    -2.00   0.046    -1.456434   -.0145584
         customer16 |  -.8604684   .3619317    -2.38   0.017    -1.569842   -.1510953
         customer17 |   .8010171   .3725337     2.15   0.032     .0708645     1.53117
         customer18 |  -.6614567     .44956    -1.47   0.141    -1.542578    .2196647
--------------------+----------------------------------------------------------------
           /lnalpha |   1.345651   .1220176    11.03   0.000     1.106501    1.584802
--------------------+----------------------------------------------------------------
              alpha |   3.840688   .4686315                      3.023761    4.878323
-------------------------------------------------------------------------------------

. transform
Note: cannot guarantee correctness if there is collinearity in the zinb model!
Warning: many options have been hard-coded; if you're running zinb with nondefault
options, you might want to check that those carry over.
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a Logit model (cmd logit) has been estimated with the
parameters of the inflate process of the zero inflated model.
Note that the point estimates have been inverted, so that a positive sign represents a positive effect.

. eststo: estpost margins, dydx($c)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     25,152
Model VCE    : Robust

Expression   : Pr(inflate), predict()
dy/dx w.r.t. : 1.treatmentper2 1.treatmentper3 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1871448   .0620906     3.01   0.003     .0654494    .3088403
1.treatmentper3 |   .2552814   .1065774     2.40   0.017     .0463936    .4641693
            age |  -.0081656   .0020527    -3.98   0.000    -.0121888   -.0041424
         tenure |    .069123   .0090494     7.64   0.000     .0513865    .0868595
         1.male |   .0532615   .0191658     2.78   0.005     .0156972    .0908258
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est1 stored)

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -479231.17  
Iteration 1:   log likelihood =  -17067.75  
Iteration 2:   log likelihood =  -15955.96  
Iteration 3:   log likelihood = -10828.957  
Iteration 4:   log likelihood = -10690.511  
Iteration 5:   log likelihood = -10680.636  
Iteration 6:   log likelihood = -10680.576  
Iteration 7:   log likelihood = -10680.575  

Iteration 0:   log likelihood = -9059.7229  (not concave)
Iteration 1:   log likelihood =  -8019.656  
Iteration 2:   log likelihood = -7987.4375  
Iteration 3:   log likelihood = -7987.3072  
Iteration 4:   log likelihood = -7987.3072  

Fitting full model:

Iteration 0:   log pseudolikelihood = -8357.6268  
Iteration 1:   log pseudolikelihood =  -7875.893  (not concave)
Iteration 2:   log pseudolikelihood = -7822.8714  
Iteration 3:   log pseudolikelihood = -7779.7312  
Iteration 4:   log pseudolikelihood = -7768.4457  
Iteration 5:   log pseudolikelihood = -7767.8577  
Iteration 6:   log pseudolikelihood = -7767.8336  
Iteration 7:   log pseudolikelihood = -7767.8333  

Zero-inflated negative binomial regression      Number of obs     =     25,152
                                                Nonzero obs       =      1,733
                                                Zero obs          =     23,419

Inflation model      = logit                    Wald chi2(32)     =          .
Log pseudolikelihood = -7767.833                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.5795847   .2998704    -1.93   0.053     -1.16732    .0081506
    1.treatmentper3 |  -.4522651    .433069    -1.04   0.296    -1.301065    .3965345
            period2 |  -.3059684   .2799127    -1.09   0.274    -.8545872    .2426504
            period3 |  -.0932869   .3481347    -0.27   0.789    -.7756185    .5890446
                age |   .1026131   .1366387     0.75   0.453    -.1651938    .3704201
                    |
        c.age#c.age |  -.0014542   .0020507    -0.71   0.478    -.0054735     .002565
                    |
             tenure |   .0805191   .0812164     0.99   0.321    -.0786621    .2397003
                    |
  c.tenure#c.tenure |  -.0081168    .007393    -1.10   0.272    -.0226068    .0063733
                    |
             1.male |   -.209422   .1381568    -1.52   0.130    -.4802044    .0613603
           salary01 |  -2.307494   2.062705    -1.12   0.263    -6.350321    1.735334
            salary2 |  -2.067861   2.162446    -0.96   0.339    -6.306177    2.170455
            salary3 |   -2.24186   2.153182    -1.04   0.298    -6.462018    1.978299
        salary4plus |  -1.293739   2.228159    -0.58   0.561     -5.66085    3.073371
        salaryother |  -8.085406   2.636898    -3.07   0.002    -13.25363   -2.917182
          customer1 |   .7053194   .2918392     2.42   0.016     .1333251    1.277314
          customer2 |  -.2806297   .2905428    -0.97   0.334    -.8500832    .2888237
          customer3 |  -.2960134   .3202046    -0.92   0.355    -.9236029     .331576
          customer4 |  -.1130191   .3071687    -0.37   0.713    -.7150587    .4890206
          customer5 |   1.064836   .3470928     3.07   0.002     .3845462    1.745125
          customer6 |  -.4041439   .3314369    -1.22   0.223    -1.053748    .2454605
          customer7 |  -.4804177   .2701017    -1.78   0.075    -1.009807    .0489719
          customer8 |   1.058475   .2456219     4.31   0.000     .5770649    1.539885
          customer9 |  -.8427544   .2323271    -3.63   0.000    -1.298107   -.3874017
         customer10 |  -.4786689   .3001979    -1.59   0.111    -1.067046    .1097081
         customer11 |  -.0871993   .3002294    -0.29   0.771    -.6756381    .5012395
         customer12 |   .0763843   .2965569     0.26   0.797    -.5048565    .6576251
         customer13 |  -.4678895   .2829004    -1.65   0.098    -1.022364    .0865852
         customer14 |  -.2602431   .4031629    -0.65   0.519    -1.050428    .5299417
         customer15 |   .1476011   .2693503     0.55   0.584    -.3803158    .6755181
         customer16 |  -.2427898   .2983226    -0.81   0.416    -.8274912    .3419117
         customer17 |  -.1734308   .2357795    -0.74   0.462    -.6355502    .2886885
         customer18 |   .2091287   .2040181     1.03   0.305    -.1907394    .6089968
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322528   .4391231    -3.01   0.003    -2.183194   -.4618629
    1.treatmentper3 |   -1.79401   .7857814    -2.28   0.022    -3.334113   -.2539066
            period2 |    .526884   .2176647     2.42   0.015      .100269    .9534989
            period3 |   1.275496   .6025057     2.12   0.034     .0946061    2.456385
                age |  -.1343899   .1210624    -1.11   0.267    -.3716679    .1028881
                    |
        c.age#c.age |   .0032638   .0017988     1.81   0.070    -.0002617    .0067893
                    |
             tenure |  -.7765933   .1051202    -7.39   0.000    -.9826251   -.5705616
                    |
  c.tenure#c.tenure |   .0363361   .0154617     2.35   0.019     .0060318    .0666405
                    |
             1.male |  -.4051985   .1564811    -2.59   0.010    -.7118959   -.0985011
           salary01 |   4.492795   2.033454     2.21   0.027     .5072977    8.478293
            salary2 |   3.667313   2.171374     1.69   0.091    -.5885009    7.923127
            salary3 |   2.721254   2.073857     1.31   0.189    -1.343432     6.78594
        salary4plus |   3.954319   1.699154     2.33   0.020     .6240393    7.284599
        salaryother |  -5.051751   9.281634    -0.54   0.586    -23.24342    13.13992
          customer1 |    .481111   .4712356     1.02   0.307    -.4424939    1.404716
          customer2 |  -2.516859   .6146042    -4.10   0.000    -3.721461   -1.312257
          customer3 |   .9248282   .4737462     1.95   0.051    -.0036972    1.853354
          customer4 |  -.4862248   .4281626    -1.14   0.256    -1.325408    .3529584
          customer5 |  -.7563505   .5033259    -1.50   0.133    -1.742851      .23015
          customer6 |  -.6620719   .4561584    -1.45   0.147    -1.556126    .2319821
          customer7 |  -2.557616   .5098507    -5.02   0.000    -3.556905   -1.558327
          customer8 |  -4.539873   1.506243    -3.01   0.003    -7.492054   -1.587691
          customer9 |  -.5644092   .3227825    -1.75   0.080    -1.197051    .0682329
         customer10 |   .1721992   .5272149     0.33   0.744     -.861123    1.205521
         customer11 |  -3.498968   .9878253    -3.54   0.000     -5.43507   -1.562865
         customer12 |  -2.561616   .8117154    -3.16   0.002    -4.152549   -.9706826
         customer13 |  -2.367817   .6263556    -3.78   0.000    -3.595451   -1.140182
         customer14 |   .4756682   .6059805     0.78   0.432    -.7120317    1.663368
         customer15 |  -.7354965   .3678323    -2.00   0.046    -1.456434   -.0145584
         customer16 |  -.8604684   .3619317    -2.38   0.017    -1.569842   -.1510953
         customer17 |   .8010171   .3725337     2.15   0.032     .0708645     1.53117
         customer18 |  -.6614567     .44956    -1.47   0.141    -1.542578    .2196647
--------------------+----------------------------------------------------------------
           /lnalpha |   1.345651   .1220176    11.03   0.000     1.106501    1.584802
--------------------+----------------------------------------------------------------
              alpha |   3.840688   .4686315                      3.023761    4.878323
-------------------------------------------------------------------------------------

. transform2
-----------------------------------------------------------------------------------------
Transform success: It now looks as if a NB2 model (cmd nbreg) has been estimated with the
parameters of the nbreg process of the zero inflated model.

. eststo: estpost margins, dydx($c)
Warning: cannot perform check for estimable functions.

Average marginal effects                        Number of obs     =     25,152
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 1.treatmentper3 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |  -.1966919    .093644    -2.10   0.036    -.3802308   -.0131529
1.treatmentper3 |  -.1587653   .1304869    -1.22   0.224     -.414515    .0969844
            age |   .0059154    .007765     0.76   0.446    -.0093038    .0211346
         tenure |   .0093047   .0149133     0.62   0.533     -.019925    .0385343
         1.male |  -.0899249   .0648754    -1.39   0.166    -.2170784    .0372286
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est2 stored)

. zinb amountideasnoweight $a  customer1-customer18,  inflate($a  customer1-customer18, noconst) noconstant cluster(custcode)

Fitting nbreg model:

Iteration 0:   log likelihood = -479231.17  
Iteration 1:   log likelihood =  -17067.75  
Iteration 2:   log likelihood =  -15955.96  
Iteration 3:   log likelihood = -10828.957  
Iteration 4:   log likelihood = -10690.511  
Iteration 5:   log likelihood = -10680.636  
Iteration 6:   log likelihood = -10680.576  
Iteration 7:   log likelihood = -10680.575  

Iteration 0:   log likelihood = -9059.7229  (not concave)
Iteration 1:   log likelihood =  -8019.656  
Iteration 2:   log likelihood = -7987.4375  
Iteration 3:   log likelihood = -7987.3072  
Iteration 4:   log likelihood = -7987.3072  

Fitting full model:

Iteration 0:   log pseudolikelihood = -8357.6268  
Iteration 1:   log pseudolikelihood =  -7875.893  (not concave)
Iteration 2:   log pseudolikelihood = -7822.8714  
Iteration 3:   log pseudolikelihood = -7779.7312  
Iteration 4:   log pseudolikelihood = -7768.4457  
Iteration 5:   log pseudolikelihood = -7767.8577  
Iteration 6:   log pseudolikelihood = -7767.8336  
Iteration 7:   log pseudolikelihood = -7767.8333  

Zero-inflated negative binomial regression      Number of obs     =     25,152
                                                Nonzero obs       =      1,733
                                                Zero obs          =     23,419

Inflation model      = logit                    Wald chi2(32)     =          .
Log pseudolikelihood = -7767.833                Prob > chi2       =          .

                                     (Std. Err. adjusted for 19 clusters in custcode)
-------------------------------------------------------------------------------------
                    |               Robust
amountideasnoweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------------+----------------------------------------------------------------
amountideasnoweight |
    1.treatmentper2 |  -.5795847   .2998704    -1.93   0.053     -1.16732    .0081506
    1.treatmentper3 |  -.4522651    .433069    -1.04   0.296    -1.301065    .3965345
            period2 |  -.3059684   .2799127    -1.09   0.274    -.8545872    .2426504
            period3 |  -.0932869   .3481347    -0.27   0.789    -.7756185    .5890446
                age |   .1026131   .1366387     0.75   0.453    -.1651938    .3704201
                    |
        c.age#c.age |  -.0014542   .0020507    -0.71   0.478    -.0054735     .002565
                    |
             tenure |   .0805191   .0812164     0.99   0.321    -.0786621    .2397003
                    |
  c.tenure#c.tenure |  -.0081168    .007393    -1.10   0.272    -.0226068    .0063733
                    |
             1.male |   -.209422   .1381568    -1.52   0.130    -.4802044    .0613603
           salary01 |  -2.307494   2.062705    -1.12   0.263    -6.350321    1.735334
            salary2 |  -2.067861   2.162446    -0.96   0.339    -6.306177    2.170455
            salary3 |   -2.24186   2.153182    -1.04   0.298    -6.462018    1.978299
        salary4plus |  -1.293739   2.228159    -0.58   0.561     -5.66085    3.073371
        salaryother |  -8.085406   2.636898    -3.07   0.002    -13.25363   -2.917182
          customer1 |   .7053194   .2918392     2.42   0.016     .1333251    1.277314
          customer2 |  -.2806297   .2905428    -0.97   0.334    -.8500832    .2888237
          customer3 |  -.2960134   .3202046    -0.92   0.355    -.9236029     .331576
          customer4 |  -.1130191   .3071687    -0.37   0.713    -.7150587    .4890206
          customer5 |   1.064836   .3470928     3.07   0.002     .3845462    1.745125
          customer6 |  -.4041439   .3314369    -1.22   0.223    -1.053748    .2454605
          customer7 |  -.4804177   .2701017    -1.78   0.075    -1.009807    .0489719
          customer8 |   1.058475   .2456219     4.31   0.000     .5770649    1.539885
          customer9 |  -.8427544   .2323271    -3.63   0.000    -1.298107   -.3874017
         customer10 |  -.4786689   .3001979    -1.59   0.111    -1.067046    .1097081
         customer11 |  -.0871993   .3002294    -0.29   0.771    -.6756381    .5012395
         customer12 |   .0763843   .2965569     0.26   0.797    -.5048565    .6576251
         customer13 |  -.4678895   .2829004    -1.65   0.098    -1.022364    .0865852
         customer14 |  -.2602431   .4031629    -0.65   0.519    -1.050428    .5299417
         customer15 |   .1476011   .2693503     0.55   0.584    -.3803158    .6755181
         customer16 |  -.2427898   .2983226    -0.81   0.416    -.8274912    .3419117
         customer17 |  -.1734308   .2357795    -0.74   0.462    -.6355502    .2886885
         customer18 |   .2091287   .2040181     1.03   0.305    -.1907394    .6089968
--------------------+----------------------------------------------------------------
inflate             |
    1.treatmentper2 |  -1.322528   .4391231    -3.01   0.003    -2.183194   -.4618629
    1.treatmentper3 |   -1.79401   .7857814    -2.28   0.022    -3.334113   -.2539066
            period2 |    .526884   .2176647     2.42   0.015      .100269    .9534989
            period3 |   1.275496   .6025057     2.12   0.034     .0946061    2.456385
                age |  -.1343899   .1210624    -1.11   0.267    -.3716679    .1028881
                    |
        c.age#c.age |   .0032638   .0017988     1.81   0.070    -.0002617    .0067893
                    |
             tenure |  -.7765933   .1051202    -7.39   0.000    -.9826251   -.5705616
                    |
  c.tenure#c.tenure |   .0363361   .0154617     2.35   0.019     .0060318    .0666405
                    |
             1.male |  -.4051985   .1564811    -2.59   0.010    -.7118959   -.0985011
           salary01 |   4.492795   2.033454     2.21   0.027     .5072977    8.478293
            salary2 |   3.667313   2.171374     1.69   0.091    -.5885009    7.923127
            salary3 |   2.721254   2.073857     1.31   0.189    -1.343432     6.78594
        salary4plus |   3.954319   1.699154     2.33   0.020     .6240393    7.284599
        salaryother |  -5.051751   9.281634    -0.54   0.586    -23.24342    13.13992
          customer1 |    .481111   .4712356     1.02   0.307    -.4424939    1.404716
          customer2 |  -2.516859   .6146042    -4.10   0.000    -3.721461   -1.312257
          customer3 |   .9248282   .4737462     1.95   0.051    -.0036972    1.853354
          customer4 |  -.4862248   .4281626    -1.14   0.256    -1.325408    .3529584
          customer5 |  -.7563505   .5033259    -1.50   0.133    -1.742851      .23015
          customer6 |  -.6620719   .4561584    -1.45   0.147    -1.556126    .2319821
          customer7 |  -2.557616   .5098507    -5.02   0.000    -3.556905   -1.558327
          customer8 |  -4.539873   1.506243    -3.01   0.003    -7.492054   -1.587691
          customer9 |  -.5644092   .3227825    -1.75   0.080    -1.197051    .0682329
         customer10 |   .1721992   .5272149     0.33   0.744     -.861123    1.205521
         customer11 |  -3.498968   .9878253    -3.54   0.000     -5.43507   -1.562865
         customer12 |  -2.561616   .8117154    -3.16   0.002    -4.152549   -.9706826
         customer13 |  -2.367817   .6263556    -3.78   0.000    -3.595451   -1.140182
         customer14 |   .4756682   .6059805     0.78   0.432    -.7120317    1.663368
         customer15 |  -.7354965   .3678323    -2.00   0.046    -1.456434   -.0145584
         customer16 |  -.8604684   .3619317    -2.38   0.017    -1.569842   -.1510953
         customer17 |   .8010171   .3725337     2.15   0.032     .0708645     1.53117
         customer18 |  -.6614567     .44956    -1.47   0.141    -1.542578    .2196647
--------------------+----------------------------------------------------------------
           /lnalpha |   1.345651   .1220176    11.03   0.000     1.106501    1.584802
--------------------+----------------------------------------------------------------
              alpha |   3.840688   .4686315                      3.023761    4.878323
-------------------------------------------------------------------------------------

. eststo: estpost margins, dydx($c)

Average marginal effects                        Number of obs     =     25,152
Model VCE    : Robust

Expression   : Predicted number of events, predict()
dy/dx w.r.t. : 1.treatmentper2 1.treatmentper3 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   -.014184    .040322    -0.35   0.725    -.0932137    .0648457
1.treatmentper3 |   .0259754   .0562126     0.46   0.644    -.0841994    .1361501
            age |  -.0018987   .0022827    -0.83   0.406    -.0063728    .0025754
         tenure |   .0284078   .0025665    11.07   0.000     .0233776     .033438
         1.male |  -.0065768   .0147683    -0.45   0.656    -.0355222    .0223685
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est3 stored)

. 
. use idealevel-expost.dta, clear

. gen shared=(sharewithcustomer=="YES")

. drop age tenure

. rename age2 age

. rename tenure2 tenure

. global b i.treatmentper2 i.treatmentper3  ideasubtype1-ideasubtype5 c.age##c.age c.tenure##c.tenure i.male salary01 salary2 sala
> ry3 salary4plus

. global d treatmentper2 treatmentper3  c.age c.tenure male

. logit shared $b customer1-customer19 month1-month39 [pweight=1/NumAuthors] if finished==1, noconstant vce(cluster custcode)

note: customer7 != 0 predicts success perfectly
      customer7 dropped and 24 obs not used

note: customer8 != 0 predicts failure perfectly
      customer8 dropped and 13 obs not used

note: customer16 != 0 predicts failure perfectly
      customer16 dropped and 38 obs not used

note: customer19 omitted because of collinearity
note: month39 omitted because of collinearity
Iteration 0:   log pseudolikelihood = -1012.3992  
Iteration 1:   log pseudolikelihood = -813.68964  
Iteration 2:   log pseudolikelihood = -811.01063  
Iteration 3:   log pseudolikelihood = -810.98235  
Iteration 4:   log pseudolikelihood = -810.97687  
Iteration 5:   log pseudolikelihood = -810.97565  
Iteration 6:   log pseudolikelihood = -810.97535  
Iteration 7:   log pseudolikelihood = -810.97529  
Iteration 8:   log pseudolikelihood = -810.97527  

Logistic regression                             Number of obs     =      2,310
                                                Wald chi2(20)     =          .
Log pseudolikelihood = -810.97527               Prob > chi2       =          .

                                   (Std. Err. adjusted for 16 clusters in custcode)
-----------------------------------------------------------------------------------
                  |               Robust
           shared |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
  1.treatmentper2 |   .9981283   .3892646     2.56   0.010     .2351837    1.761073
  1.treatmentper3 |   .1015298    1.08254     0.09   0.925     -2.02021    2.223269
     ideasubtype1 |  -7.046019   3.190735    -2.21   0.027    -13.29974   -.7922926
     ideasubtype2 |  -7.306141   3.314337    -2.20   0.027    -13.80212   -.8101609
     ideasubtype3 |  -7.782037   3.311517    -2.35   0.019    -14.27249   -1.291582
     ideasubtype4 |  -7.834167   3.187712    -2.46   0.014    -14.08197   -1.586365
     ideasubtype5 |  -7.742814   3.320222    -2.33   0.020    -14.25033   -1.235299
              age |  -.2631287   .1832574    -1.44   0.151    -.6223065    .0960492
                  |
      c.age#c.age |   .0033599   .0029282     1.15   0.251    -.0023792    .0090989
                  |
           tenure |   .2688589   .0990909     2.71   0.007     .0746443    .4630735
                  |
c.tenure#c.tenure |  -.0103944   .0086804    -1.20   0.231    -.0274076    .0066188
                  |
           1.male |   .1119798   .2379404     0.47   0.638    -.3543749    .5783344
         salary01 |   10.80878   .7456795    14.50   0.000     9.347272    12.27028
          salary2 |   11.15895   .6765462    16.49   0.000      9.83294    12.48495
          salary3 |     11.376   .6525537    17.43   0.000     10.09701    12.65498
      salary4plus |   11.87625   .6333972    18.75   0.000     10.63482    13.11769
        customer1 |   1.047142   .4919657     2.13   0.033     .0829067    2.011377
        customer2 |   .1152346   .3773634     0.31   0.760    -.6243841    .8548533
        customer3 |   .5067602   .2886811     1.76   0.079    -.0590445    1.072565
        customer4 |   2.298403   .4750945     4.84   0.000     1.367235    3.229571
        customer5 |  -.2217068   .4151373    -0.53   0.593    -1.035361    .5919473
        customer6 |   1.494243   .4791272     3.12   0.002     .5551709    2.433315
        customer7 |          0  (omitted)
        customer8 |          0  (omitted)
        customer9 |   .4397398   .3390326     1.30   0.195    -.2247519    1.104231
       customer10 |  -.5315958   .4991918    -1.06   0.287    -1.509994    .4468021
       customer11 |  -.9647523    .325956    -2.96   0.003    -1.603614   -.3258903
       customer12 |   .4413315   .4295556     1.03   0.304    -.4005821    1.283245
       customer13 |   3.222384   .5616577     5.74   0.000     2.121555    4.323213
       customer14 |   .8223984   .3484091     2.36   0.018     .1395291    1.505268
       customer15 |   .3279476   .3557932     0.92   0.357    -.3693941    1.025289
       customer16 |          0  (omitted)
       customer17 |   1.471478   .2687929     5.47   0.000     .9446535    1.998302
       customer18 |   .0075901   .2135828     0.04   0.972    -.4110245    .4262047
       customer19 |          0  (omitted)
           month1 |  -.8839332   1.111602    -0.80   0.427    -3.062634    1.294767
           month2 |  -1.151888   1.248106    -0.92   0.356     -3.59813    1.294354
           month3 |  -.6612427   1.236275    -0.53   0.593    -3.084296    1.761811
           month4 |  -.6153927   1.233867    -0.50   0.618    -3.033727    1.802942
           month5 |  -.5785259   1.316154    -0.44   0.660    -3.158141    2.001089
           month6 |  -.3201038   1.249756    -0.26   0.798     -2.76958    2.129372
           month7 |   .1228001   1.273942     0.10   0.923     -2.37408    2.619681
           month8 |   .8315753   1.298599     0.64   0.522    -1.713632    3.376782
           month9 |  -1.145843   1.466482    -0.78   0.435    -4.020094    1.728408
          month10 |  -1.339912    1.44421    -0.93   0.354    -4.170511    1.490687
          month11 |  -.1805911   1.417278    -0.13   0.899    -2.958405    2.597223
          month12 |  -.0926102   1.477753    -0.06   0.950    -2.988954    2.803733
          month13 |   .1150484   1.501694     0.08   0.939    -2.828218    3.058315
          month14 |  -.6968583    1.60564    -0.43   0.664    -3.843855    2.450139
          month15 |   -1.00135   1.799748    -0.56   0.578    -4.528791    2.526091
          month16 |  -1.197865   1.239943    -0.97   0.334    -3.628109    1.232379
          month17 |  -.6382913   1.390769    -0.46   0.646    -3.364148    2.087565
          month18 |  -1.532643   1.101589    -1.39   0.164    -3.691718    .6264323
          month19 |  -.9499699   1.369676    -0.69   0.488    -3.634485    1.734545
          month20 |  -.9740914    1.23349    -0.79   0.430    -3.391688    1.443505
          month21 |  -.6867669    1.36647    -0.50   0.615    -3.364999    1.991465
          month22 |  -.8701563   1.429189    -0.61   0.543    -3.671316    1.931003
          month23 |   .5598124    1.42372     0.39   0.694    -2.230628    3.350253
          month24 |  -.6073886   1.224451    -0.50   0.620    -3.007268    1.792491
          month25 |  -.5472439   1.498988    -0.37   0.715    -3.485206    2.390718
          month26 |  -.8905235     1.6777    -0.53   0.596    -4.178754    2.397707
          month27 |   .0684955   1.135525     0.06   0.952    -2.157093    2.294084
          month28 |   .2088123    1.03141     0.20   0.840    -1.812715     2.23034
          month29 |   .7895071     .95924     0.82   0.410    -1.090569    2.669583
          month30 |   .2657391   1.092991     0.24   0.808    -1.876484    2.407962
          month31 |   .0668444   .9708774     0.07   0.945     -1.83604    1.969729
          month32 |  -1.294667   1.059089    -1.22   0.222    -3.370442    .7811087
          month33 |  -.2349501   1.076051    -0.22   0.827    -2.343972    1.874071
          month34 |   .5528218   1.117684     0.49   0.621    -1.637799    2.743442
          month35 |  -.6078056   1.151986    -0.53   0.598    -2.865657    1.650046
          month36 |  -.5576464   1.055364    -0.53   0.597    -2.626122    1.510829
          month37 |  -.9287333    1.06219    -0.87   0.382    -3.010587     1.15312
          month38 |  -2.018437    1.27244    -1.59   0.113    -4.512373    .4754985
          month39 |          0  (omitted)
-----------------------------------------------------------------------------------

. eststo: estpost margins, dydx($d)

Average marginal effects                        Number of obs     =      2,310
Model VCE    : Robust

Expression   : Pr(shared), predict()
dy/dx w.r.t. : 1.treatmentper2 1.treatmentper3 age tenure 1.male

---------------------------------------------------------------------------------
                |            Delta-method
                |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.treatmentper2 |   .1802358   .0660511     2.73   0.006      .050778    .3096935
1.treatmentper3 |    .019029   .2020939     0.09   0.925    -.3770678    .4151258
            age |  -.0116206   .0037038    -3.14   0.002      -.01888   -.0043613
         tenure |   .0340686   .0100261     3.40   0.001     .0144178    .0537195
         1.male |   .0211484   .0448767     0.47   0.637    -.0668082     .109105
---------------------------------------------------------------------------------
Note: dy/dx for factor levels is the discrete change from the base level.
(est4 stored)

. 
. 
.         #delimit ;
delimiter now ;
.         esttab using "$dir\tabs\6_Post-treatment-effects.tex", 
>         cells(b(star fmt(%9.3f)) se(par fmt(%9.3f) )) starlevels(* .10 ** 0.05 *** .01) 
>         stats(ll N_clust N, fmt(%9.2f %9.0f %9.0f) labels(Log Pseudo likelihood Clusters Observations))
>         keep( 1.treatmentper2 1.treatmentper3 age tenure 1.male) 
>         order(1.treatmentper2 1.treatmentper3 age tenure 1.male)
>         varlabels(1.treatmentper2 "DID Treatment" 1.treatmentper3 "DID Post Treatment" age Age tenure Tenure 1.male Male NumAuth
> ors "Number of Authors", 
>         elist(1.treatmentper2 "[2mm]" 1.treatmentper3 "[2mm]" age "[2mm]" tenure "[2mm]" 1.male 
>          "\midrule  Controls salary groups  &yes & yes & yes &yes   \\ 
>          Client FE  &yes & yes & yes &yes   \\ Time FE  &period & period & period &month   \\ " )) 
>          nonumbers collabels(,none) mlabels("\specialcell{(1) Zero Inflated NB\\ Logit AME}"  
>         "\specialcell{(2) Zero Inflated NB\\ Negative Binomial AME}" "\specialcell{(3) Quantity effect\\ ZINB AME}" "\specialcel
> l{(4) Quality\\ Logit AME}") 
>         prehead("\begin{table}[h]%" "\small" "\caption{\label{tab:quantall-inflated-expost}Idea quantity and quality, treatment 
> and post treatment effects}%" 
>         "\begin{center}%" "\begin{tabular}{lcccc}" 
>         "\toprule") posthead("[3mm] Dependent variable &  Pr(Participation) & NumIdeas$|$Participation & NumIdeas & Shared \\" "
> \midrule")  prefoot("") 
>         postfoot("\bottomrule" "\end{tabular}" "\\ [2mm] \begin{minipage}{\textwidth}" 
>         "\footnotesize" "{\it Note:} 
>         
>         The table reports marginal effects for a zero inflated negative binomial model          
>         explaining the number of ideas per author and period, and for a Logit model explaining the 
>         probability of sharing an idea with the client.          Marginal effects of \textit{Age} and 
> \textit{Tenure} are based on linear and quadratic terms. Standard errors are clustered at the client team level. ***Significant 
> at the 1\% level; **significant at the 5\% level; *significant at the 10\% level.         
>         
>         " "\end{minipage}" 
>         "\end{center}" "\end{table}") style(tex) replace
> ;
(output written to C:\Dropbox\GNS Creativity\india\tabs\6_Post-treatment-effects.tex)

. #delimit cr
delimiter now cr
. 
end of do-file

. log close
      name:  <unnamed>
       log:  C:\Users\csiemrot\Desktop\GNS 2014 Stata code\tablecreate.log
  log type:  text
 closed on:  19 Jun 2016, 19:55:37
----------------------------------------------------------------------------------------------------------------------------------
